:root {
    /* -- Color Palette ----------------------------------- */

    /* Primary - Pokeball Red (kept from current brand) */
    --red: #ab1802;
    --red-dark: #8b1401;
    --red-light: #c2361d;

    /* Secondary - Ultra Ball Blue */
    --blue: #1e88e5;
    --blue-dark: #1565c0;
    --blue-light: #42a5f5;

    /* Status colors */
    --success: #2e7d32;
    --success-dark: #1b5e20;
    --success-light: #4caf50;
    --warning: #f57f17;
    --danger: var(--red);
    --info: var(--blue);

    /* Legacy palette aliases (kept for existing rules) */
    --gold: #d69e2e;
    --green: var(--success);

    /* Neutral grays - 11-step scale */
    --gray-50:  #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #eeeeee;
    --gray-300: #e0e0e0;
    --gray-400: #bdbdbd;
    --gray-500: #9e9e9e;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;

    /* Surfaces and text */
    --bg: #ffffff;
    --bg-alt: var(--gray-50);
    --surface: #ffffff;
    --surface-hover: var(--gray-50);
    --border: var(--gray-200);
    --text: var(--gray-900);
    --text-secondary: var(--gray-700);
    --text-tertiary: var(--gray-500);
    --text-inverse: #ffffff;

    /* Legacy white alias (still referenced by older rules) */
    --white: #ffffff;

    /* Pokemon type palette - 18 official type colors */
    --type-normal:   #a8a878;
    --type-fire:     #f08030;
    --type-water:    #6890f0;
    --type-electric: #f8d030;
    --type-grass:    #78c850;
    --type-ice:      #98d8d8;
    --type-fighting: #c03028;
    --type-poison:   #a040a0;
    --type-ground:   #e0c068;
    --type-flying:   #a890f0;
    --type-psychic:  #f85888;
    --type-bug:      #a8b820;
    --type-rock:     #b8a038;
    --type-ghost:    #705898;
    --type-dragon:   #7038f8;
    --type-dark:     #705848;
    --type-steel:    #b8b8d0;
    --type-fairy:    #ee99ac;

    /* -- Spacing - 4px scale ----------------------------- */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;

    /* -- Border Radius (Plan 11: tightened scale) -------- */
    --radius-xs:   0;
    --radius-sm:   2px;
    --radius-md:   4px;
    --radius-lg:   4px;
    --radius-xl:   8px;
    --radius-full: 9999px;

    /* -- Shadows (Plan 11: hard-offset retro) ------------ */
    --shadow-xs:  0 1px 0 rgba(0, 0, 0, 0.06);
    --shadow-sm:  1px 1px 0 rgba(0, 0, 0, 0.08);
    --shadow-md:  2px 2px 0 rgba(0, 0, 0, 0.10);
    --shadow-lg:  3px 3px 0 rgba(0, 0, 0, 0.14);
    --shadow-xl:  4px 4px 0 rgba(0, 0, 0, 0.18);
    /* Signature pop: on-clock banner, primary CTA, hero-aligned surfaces */
    --shadow-pop: 4px 4px 0 var(--red-dark);

    /* -- Typography ---------------------------------------- */
    --font-display:    "Pixelify Sans", "Jersey 15", ui-monospace, monospace;
    --font-display-sm: "Jersey 15", ui-monospace, monospace;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "Menlo", "SF Mono", monospace;

    --text-xs:  0.75rem;
    --text-sm:  0.875rem;
    --text-base: 1rem;
    --text-lg:  1.125rem;
    --text-xl:  1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;

    --leading-tight:   1.25;
    --leading-snug:    1.375;
    --leading-normal:  1.5;
    --leading-relaxed: 1.75;

    --weight-normal:   400;
    --weight-medium:   500;
    --weight-semibold: 600;
    --weight-bold:     700;
    --weight-extrabold: 800;

    /* -- Motion ------------------------------------------ */
    --duration-fast: 0.12s;
    --duration-base: 0.2s;
    --duration-slow: 0.3s;
    --ease-out: cubic-bezier(0.0, 0.0, 0.2, 1);

    /* -- Z-index scale ----------------------------------- */
    --z-dropdown:   50;
    --z-sticky:    100;
    --z-fixed:     200;
    --z-modal-bg:  900;
    --z-modal:    1000;
    --z-tooltip:  1100;
    --z-toast:    2000;

    /* -- Backwards-compat aliases ------------------------ */
    --radius: var(--radius-md);
    --shadow: var(--shadow-md);
    --font: var(--font-body);
    --card-bg: var(--surface);
    --input-bg: var(--bg-alt);
}

/* --- Dark mode --- */
[data-theme="dark"] {
    --red: #1a7a3e;
    --red-dark: #135e2e;

    --bg: #111111;
    --bg-alt: #1a1a1a;
    --surface: #222222;
    --surface-hover: #2a2a2a;
    --border: #383838;

    --text: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-tertiary: #808080;
    --text-inverse: #111111;

    --gray-50:  #1a1a1a;
    --gray-100: #222222;
    --gray-200: #2a2a2a;
    --gray-300: #383838;
    --gray-400: #555555;
    --gray-500: #808080;
    --gray-600: #aaaaaa;
    --gray-700: #c8c8c8;
    --gray-800: #e0e0e0;
    --gray-900: #f0f0f0;

    --white: #222222;
    --card-bg: #222222;
    --input-bg: #1a1a1a;

    /* Plan 11: hard-offset shadow overrides for dark mode (deeper alpha so they remain visible) */
    --shadow-xs:  0 1px 0 rgba(255, 255, 255, 0.04);
    --shadow-sm:  1px 1px 0 rgba(0, 0, 0, 0.40);
    --shadow-md:  2px 2px 0 rgba(0, 0, 0, 0.50);
    --shadow-lg:  3px 3px 0 rgba(0, 0, 0, 0.60);
    --shadow-xl:  4px 4px 0 rgba(0, 0, 0, 0.70);
    --shadow-pop: 4px 4px 0 var(--red-dark);

    /* Keep the existing dark-mode emerald accent option, but as a separate token */
    --accent: #1a7a3e;
    --accent-dark: #135e2e;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
[data-theme="dark"] body { background: #111111; }
[data-theme="dark"] a { color: #60a5fa; }
[data-theme="dark"] .admin-nav { background: #1a1a1a !important; }
[data-theme="dark"] .admin-nav .nav-brand { color: #e0e0e0; }
[data-theme="dark"] .admin-nav .nav-links a { color: rgba(255,255,255,.75); }
[data-theme="dark"] .admin-nav .nav-user { color: rgba(255,255,255,.5); }
[data-theme="dark"] .admin-body { background: #111111; }
[data-theme="dark"] .admin-sidebar { background: #222222; border-color: #383838; }
[data-theme="dark"] .admin-sidebar nav a { color: #e0e0e0; }
[data-theme="dark"] .admin-sidebar nav a:hover { background: #1a1a1a; }
[data-theme="dark"] .btn { background: #222222; border-color: #383838; color: #e0e0e0; }
[data-theme="dark"] .btn:hover { background: #2e2e2e; }
[data-theme="dark"] .btn-primary { background: var(--red); border-color: var(--red-dark); color: #fff; }
[data-theme="dark"] .btn-primary:hover { background: var(--red-dark); }
[data-theme="dark"] .btn-success { background: var(--green); border-color: #2f855a; color: #fff; }
[data-theme="dark"] .btn-danger { background: var(--red); border-color: var(--red-dark); color: #fff; }
[data-theme="dark"] .badge-setup, [data-theme="dark"] .badge-complete, [data-theme="dark"] .badge-scheduled { background: #2e2e2e; color: #999999; }
[data-theme="dark"] .badge-drafting { background: #1e3a5f; color: #90cdf4; }
[data-theme="dark"] .badge-active { background: #1a2e23; color: #68d391; }
[data-theme="dark"] .badge-playoffs { background: #2d2010; color: #f6e05e; }
[data-theme="dark"] .badge-mega { background: #2d1a4a; color: #b794f4; }
[data-theme="dark"] .alert-warning { background: #2d2010; border-color: #744210; color: #f6d860; }
[data-theme="dark"] .on-clock-banner { background: #2d2010; border-color: #744210; }
[data-theme="dark"] .on-clock-label { background: #744210; color: #fefce8; }
[data-theme="dark"] .on-clock-team, [data-theme="dark"] .on-clock-pick { color: #f6d860; }
[data-theme="dark"] .col-on-clock { background: #2d2010 !important; }
[data-theme="dark"] .draft-board th { background: #1a1a1a; }
[data-theme="dark"] .draft-board th:first-child,
[data-theme="dark"] .draft-board thead th:first-child { background: #1a1a1a; }
[data-theme="dark"] .draft-board td:first-child { background: #222222; }
[data-theme="dark"] .sched-current td { background: #1e2d12 !important; }
[data-theme="dark"] .sched-win { background: #1a2e23 !important; }
[data-theme="dark"] .sched-loss { background: #2d1a1a !important; }
[data-theme="dark"] .standings-table .playoff-spot td { background: #1a2010 !important; }
[data-theme="dark"] .pts-bar-wrap { background: #383838; }
[data-theme="dark"] .form-row input, [data-theme="dark"] .form-row select, [data-theme="dark"] .form-row textarea {
    background: #1a1a1a; border-color: #383838; color: #e0e0e0;
}
[data-theme="dark"] .league-sidebar nav a { color: var(--text); background: var(--surface); }
[data-theme="dark"] .league-sidebar nav a:hover { background: var(--surface-hover); }
[data-theme="dark"] .roster-card { background: #222222; border-color: #383838; }
[data-theme="dark"] .card:hover { border-color: #60a5fa; }
[data-theme="dark"] code { background: #383838; color: #e0e0e0; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    background: var(--bg-alt);
    color: var(--text);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    line-height: var(--leading-tight);
    font-weight: var(--weight-bold);
    margin: 0;
}
h1 { font-size: var(--text-3xl); font-weight: var(--weight-extrabold); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); font-weight: var(--weight-semibold); }
h4 { font-size: var(--text-lg); font-weight: var(--weight-semibold); }
h5 { font-size: var(--text-base); font-weight: var(--weight-semibold); }

code, kbd, .points, .stat-value {
    font-family: var(--font-mono);
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Navbar --- */
.navbar {
    background: var(--red);
    color: var(--white);
    box-shadow: var(--shadow);
    border-bottom: 4px solid var(--red-dark);
}
.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: .35rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0;
}
.nav-brand { color: var(--white); font-weight: 700; font-size: 1.1rem; }
.nav-brand:hover { text-decoration: none; color: rgba(255,255,255,.85); }
.nav-left { display: flex; align-items: center; margin-left: 1rem; }
.nav-left a, .nav-left .nav-dropdown-btn { color: rgba(255,255,255,.9); font-size: .9rem; }
.nav-left a:hover { color: var(--white); text-decoration: none; }
.nav-spacer { flex: 1; }
.nav-links { display: flex; gap: .5rem; align-items: center; }
.nav-links a { color: rgba(255,255,255,.9); font-size: .9rem; }
.nav-links a:hover { color: var(--white); text-decoration: none; }
.nav-admin { background: rgba(0,0,0,.2); padding: var(--space-1) var(--space-3); border-radius: var(--radius-md); }

/* Nav dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,.9);
    font-size: .85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .3rem;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-md);
    line-height: 1.4;
}
.nav-dropdown-btn:hover { background: rgba(255,255,255,.15); color: var(--white); }
.nav-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + .35rem);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    z-index: var(--z-fixed);
    display: none;
    overflow: hidden;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
    display: block;
    padding: var(--space-2) var(--space-4);
    font-size: .875rem;
    color: var(--gray-800) !important;
    text-decoration: none;
}
.nav-dropdown-menu a:hover { background: var(--gray-100); color: var(--gray-800) !important; text-decoration: none; }
.nav-dropdown-divider { margin: .25rem 0; border: none; border-top: 1px solid var(--gray-200); }
.nav-section-label {
    display: block;
    padding: .4rem 1rem .2rem;
    font-size: .68rem;
    font-family: var(--font-display-sm);
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--gray-500);
    pointer-events: none;
}
.nav-section-loading,
.nav-section-empty {
    display: block;
    padding: .35rem 1rem .5rem;
    font-size: .82rem;
    color: var(--gray-500);
    font-style: italic;
}

/* Dark mode toggle */
.dark-toggle {
    background: rgba(255,255,255,.15);
    border: none;
    border-radius: var(--radius-md);
    color: rgba(255,255,255,.9);
    cursor: pointer;
    font-size: 1rem;
    padding: var(--space-1) var(--space-2);
    line-height: 1;
    transition: background var(--duration-fast);
}
.dark-toggle:hover { background: rgba(255,255,255,.3); }

/* --- Notification bell --- */
.notif-bell { position: relative; }
.notif-bell-btn {
    background: rgba(255,255,255,.15);
    border: none;
    border-radius: var(--radius-md);
    color: rgba(255,255,255,.9);
    cursor: pointer;
    padding: .28rem .45rem;
    line-height: 1;
    display: flex;
    align-items: center;
    position: relative;
    transition: background var(--duration-fast);
}
.notif-bell-btn:hover { background: rgba(255,255,255,.3); }
.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--red);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    line-height: 1;
    min-width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    pointer-events: none;
}
.notif-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 320px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-toast);
    overflow: hidden;
}
.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .65rem var(--space-4);
    border-bottom: 1px solid var(--gray-200);
    font-size: .82rem;
    font-weight: 600;
    color: var(--gray-700);
}
.notif-mark-read {
    background: none;
    border: none;
    color: var(--red);
    font-size: .78rem;
    cursor: pointer;
    padding: 0;
    font-weight: 500;
}
.notif-mark-read:hover { text-decoration: underline; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .7rem var(--space-4);
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    color: var(--gray-700);
    transition: background var(--duration-fast);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--gray-100); text-decoration: none; color: var(--gray-700); }
.notif-unread { background: rgba(var(--red-rgb, 220,38,38),.05); }
.notif-unread .notif-title { font-weight: 600; color: var(--gray-800); }
.notif-title { font-size: .84rem; line-height: 1.35; }
.notif-time { font-size: .72rem; color: var(--gray-400); }
.notif-empty { padding: 1.2rem 1rem; font-size: .84rem; color: var(--gray-400); margin: 0; text-align: center; }
[data-theme="dark"] .notif-dropdown { background: var(--card-bg); border-color: var(--border); }
[data-theme="dark"] .notif-dropdown-header { border-color: var(--border); color: var(--text); }
[data-theme="dark"] .notif-item { color: var(--text); border-color: var(--border); }
[data-theme="dark"] .notif-item:hover { background: #2a2a2a; color: var(--text); }
[data-theme="dark"] .notif-unread { background: rgba(26,122,62,.1); }
[data-theme="dark"] .notif-unread .notif-title { color: #e0e0e0; }
[data-theme="dark"] .notif-list { scrollbar-color: #444 transparent; }

/* --- Container --- */
.container { max-width: 1280px; margin: 0 auto; padding: var(--space-6) var(--space-5); }

/* --- League layout with sidebar --- */
.league-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: var(--space-5);
    padding: var(--space-5);
    align-items: start;
    max-width: 1280px;
    margin: 0 auto;
}
.league-sidebar {
    display: flex;
    flex-direction: column;
    align-self: start;
    position: sticky;
    top: var(--space-5);
    gap: 2px;
}
.league-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.league-sidebar nav a {
    padding: var(--space-3) var(--space-4);
    color: var(--text);
    font-family: var(--font-display);
    font-size: .95rem;
    border-left: 4px solid transparent;
    background: var(--surface);
    display: block;
}
.league-sidebar nav a:hover {
    background: var(--surface-hover);
    border-left-color: var(--red-light);
    text-decoration: none;
    color: var(--text);
}
.league-sidebar nav a.sidebar-active {
    border-left-color: var(--red);
    font-weight: 600;
    color: var(--red);
}
.league-content {
    min-width: 0;
}

/* --- Cards --- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--duration-base), transform var(--duration-base);
}
.card:hover {
    border-color: var(--blue);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

/* --- Page header --- */
.page-header { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-5); flex-wrap: wrap; }
.page-header h1 { font-size: 1.75rem; }
.subtitle { color: var(--gray-600); font-size: .95rem; }

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: var(--radius-full);
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.badge-setup    { background: var(--gray-100); color: var(--gray-600); }
.badge-drafting { background: #ebf4ff; color: var(--blue); }
.badge-active   { background: #f0fff4; color: var(--green); }
.badge-playoffs { background: #fffff0; color: var(--gold); }
.badge-complete { background: var(--gray-100); color: var(--gray-600); }
.badge-scheduled { background: var(--gray-100); color: var(--gray-600); }
.badge-mega     { background: #faf5ff; color: #6b46c1; font-size: .65rem; padding:.1rem .4rem; }

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-800);
    font-size: .875rem;
    cursor: pointer;
    line-height: 1.4;
}
.btn:hover { background: var(--gray-100); text-decoration: none; }
.btn-primary { background: var(--red); border-color: var(--red-dark); color: var(--white); }
.btn-primary:hover { background: var(--red-dark); }
.btn-success { background: var(--green); border-color: #2f855a; color: var(--white); }
.btn-danger  { background: var(--red); border-color: var(--red-dark); color: #fff; }
.btn-sm { padding: var(--space-1) var(--space-2); font-size: .8rem; }

/* --- Tables --- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: .6rem .85rem; text-align: left; border-bottom: 1px solid var(--gray-200); }
th { background: var(--gray-50); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-600); }
tr:hover td { background: var(--gray-50); }

/* --- Tab bar --- */
.tab-bar { display: flex; gap: .25rem; border-bottom: 2px solid var(--gray-200); margin-bottom: 1.25rem; }
.tab-btn {
    background: none; border: none; border-bottom: 2px solid transparent;
    margin-bottom: -2px; padding: .5rem 1rem; font-size: .9rem; font-weight: 600;
    color: var(--gray-500); cursor: pointer; transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--gray-700); }
.tab-btn.tab-active { color: var(--red); border-bottom-color: var(--red); }
[data-theme="dark"] .tab-bar { border-color: var(--border); }
[data-theme="dark"] .tab-btn:hover { color: var(--text); }
[data-theme="dark"] .tab-btn.tab-active { color: var(--red); border-bottom-color: var(--red); }

/* --- Section --- */
.section { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem; box-shadow: var(--shadow); }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.section h2 { font-size: 1.1rem; }

/* --- Alerts --- */
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9rem; }
.alert-warning { background: #fffff0; border: 1px solid #f6e05e; color: #744210; }

/* --- Season complete banner --- */
.league-complete-banner {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: linear-gradient(90deg, #fffceb 0%, #fffef7 100%);
    border: 1px solid var(--gold);
    border-radius: var(--radius);
    color: #5a3e00;
    padding: .65rem 1rem;
    margin-bottom: 1rem;
    font-size: .9rem;
    font-weight: 600;
    box-shadow: 2px 2px 0 #f3e8b5;
}
[data-theme="dark"] .league-complete-banner {
    background: #2a2410;
    border-color: var(--gold);
    color: #f6e05e;
    box-shadow: 2px 2px 0 #1a1608;
}

/* --- Empty state --- */
.empty-state { color: var(--gray-400); font-size: .9rem; padding: 2rem 1rem; text-align: center; }

/* --- League cards --- */
.league-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 1rem; }
.league-card { display: block; color: inherit; }
.league-card:hover { text-decoration: none; }
.league-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.league-card-header h2 { font-size: 1.1rem; }
.league-card-meta { display: flex; gap: 1rem; font-size: .85rem; color: var(--gray-600); }

/* --- Team grid --- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 1rem; margin-top: 1rem; }
.team-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 1rem; color: inherit; }
.team-card:hover { text-decoration: none; }
.team-logo { width: 64px; height: 64px; object-fit: contain; margin-bottom: .5rem; }
.team-logo-lg { width: 80px; height: 80px; object-fit: contain; }
.team-abbr { font-weight: 700; font-size: 1rem; }
.team-name { font-size: .9rem; }
.coach-name { font-size: .8rem; color: var(--gray-600); }
.team-info { display: flex; flex-direction: column; gap: .15rem; }

/* --- Draft board --- */
.draft-board-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 78vh;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}
.draft-board { width: max-content; border-collapse: collapse; }
.draft-board th {
    white-space: nowrap;
    width: 130px; min-width: 100px; max-width: 160px;
    position: sticky; top: 0; z-index: 2;
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
}
.draft-board th:first-child,
.draft-board td:first-child {
    position: sticky; left: 0; z-index: 1;
    background: var(--white);
}
.draft-board thead th:first-child { z-index: 3; background: var(--gray-50); }
.round-col-header { width: 48px; min-width: 48px; max-width: 48px; }
.round-label { font-weight: 700; color: var(--gray-600); width: 48px; text-align: center; padding: .5rem .4rem; }
.pick-cell { vertical-align: top; padding: .5rem; }
.pick-content { display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.pick-sprite { width: 56px; height: 56px; object-fit: contain; }
.pick-name { font-size: .8rem; font-weight: 600; text-align: center; }
.pick-pts { font-size: .7rem; color: var(--gray-600); }
.empty-pick { color: var(--gray-400); }
.team-col-header { display: flex; flex-direction: column; padding: .5rem .35rem; }
.team-col-header .abbr { font-size: .7rem; color: var(--gray-600); }
.team-col-header .name { font-size: .85rem; }
.col-on-clock { background: #fffbeb !important; }
.on-clock-banner {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    background: #fffbeb; border: 1px solid #f6e05e; border-radius: var(--radius);
    padding: .75rem 1.25rem; margin-bottom: 1.25rem;
}
.on-clock-label {
    font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: #744210; background: #f6e05e;
    padding: .15rem .5rem; border-radius: 99px;
}
.on-clock-team { font-weight: 600; color: #744210; }
.on-clock-pick { margin-left: auto; font-size: .85rem; color: #744210; }

/* --- Standings --- */
.standings-table .stat-w { color: var(--green); font-weight: 600; }
.standings-table .stat-l { color: var(--red); }
.standings-table .stat-diff.positive { color: var(--green); }
.standings-table .stat-diff.negative { color: var(--red); }
.standings-table .stat-pf { color: var(--gray-600); }
.standings-table .stat-pa { color: var(--gray-600); }
.standings-table .playoff-spot td { background: #fffff0; }
.playoff-note { font-size: .85rem; color: var(--gray-600); margin-top: .75rem; }
.inline-logo { width: 24px; height: 24px; object-fit: contain; vertical-align: middle; margin-right: .25rem; }

/* --- Single roster --- */
.roster-meta { display: flex; gap: 1.5rem; font-size: .9rem; margin-bottom: .75rem; flex-wrap: wrap; }
.pts-bar-wrap { height: 6px; background: var(--gray-200); border-radius: 99px; margin-bottom: 1.25rem; overflow: hidden; }
.pts-bar { height: 100%; background: var(--red); border-radius: 99px; transition: width .3s; }
.roster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 1rem; }
.roster-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: .75rem; display: flex; flex-direction: column; align-items: center; text-align: center; box-shadow: var(--shadow); }
.roster-sprite { width: 72px; height: 72px; object-fit: contain; }
.roster-grid-sm { grid-template-columns: repeat(auto-fill, minmax(112px,1fr)); gap: .65rem; }
.roster-grid-sm .roster-card { padding: .5rem; }
.roster-grid-sm .roster-sprite { width: 58px; height: 58px; }
.roster-grid-sm .pokemon-name { font-size: .8rem; }
.roster-grid-sm .pokemon-pts { font-size: .7rem; }
.roster-sprite-placeholder { width: 72px; height: 72px; background: var(--gray-100); border-radius: 50%; }
.roster-card-info { display: flex; flex-direction: column; gap: .2rem; margin-top: .5rem; }
.pokemon-name { font-weight: 600; font-size: .9rem; }
.pokemon-pts { font-size: .75rem; color: var(--gray-600); }
.pokemon-types { display: flex; gap: .25rem; justify-content: center; flex-wrap: wrap; }

/* --- All-rosters table --- */
.roster-all-wrap { overflow-x: auto; }
.roster-all-table { border-collapse: collapse; font-size: .85rem; }
.roster-all-table th, .roster-all-table td { border: 1px solid var(--gray-200); }
.roster-all-table .slot-col { width: 40px; text-align: center; padding: .4rem .5rem; background: var(--gray-50); color: var(--gray-600); font-size: .75rem; white-space: nowrap; font-weight: 600; }
.roster-all-table .team-head { min-width: 155px; padding: .6rem .75rem; text-align: center; background: var(--gray-50); }
.roster-all-table .meta-row td { padding: .35rem .5rem; background: var(--gray-100); font-size: .8rem; text-align: center; }
.roster-all-table .pick-cell { padding: .35rem .5rem; vertical-align: middle; text-align: center; }
.pick-mini { display: flex; align-items: center; gap: .3rem; justify-content: flex-start; }
.pick-mini img { width: 32px; height: 32px; object-fit: contain; flex-shrink: 0; }
.pick-mini-name { font-size: .78rem; font-weight: 600; line-height: 1.2; text-align: left; }
.pick-mini-pts { font-size: .7rem; color: var(--gray-600); }

/* --- Type badges (scoped to .type so .type-X classes don't bleed onto parents) --- */
.type { display: inline-block; padding: .1rem .45rem; border-radius: 3px; font-size: .7rem; font-weight: 600; color: #fff; text-transform: uppercase; }
.type.type-fire { background: #f08030; }
.type.type-water { background: #6890f0; }
.type.type-grass { background: #78c850; }
.type.type-electric { background: #f8d030; color: #333; }
.type.type-ice { background: #98d8d8; color: #333; }
.type.type-fighting { background: #c03028; }
.type.type-poison { background: #a040a0; }
.type.type-ground { background: #e0c068; color: #333; }
.type.type-flying { background: #a890f0; }
.type.type-psychic { background: #f85888; }
.type.type-bug { background: #a8b820; }
.type.type-rock { background: #b8a038; }
.type.type-ghost { background: #705898; }
.type.type-dragon { background: #7038f8; }
.type.type-dark { background: #705848; }
.type.type-steel { background: #b8b8d0; color: #333; }
.type.type-fairy { background: #ee99ac; }
.type.type-normal { background: #a8a878; }

/* --- Schedule grid --- */
.sched-grid-wrap { overflow-x: auto; margin-bottom: 1rem; }
.sched-grid { border-collapse: collapse; min-width: 100%; }
.sched-grid th, .sched-grid td { border: 1px solid var(--gray-200); padding: 0; }
.sched-grid thead th {
    background: var(--gray-50); text-align: center;
    font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-600);
    padding: .5rem .4rem; white-space: nowrap;
}
.sched-week-col { width: 52px; text-align: left !important; }
.sched-date-col { width: 64px; }
.sched-team-col { min-width: 72px; }
.sched-team-logo { width: 20px; height: 20px; object-fit: contain; display: block; margin: 0 auto .2rem; }
.sched-row td { vertical-align: middle; }
.sched-row:hover td { background: var(--gray-50); }
.sched-current td { background: #fffbeb !important; }
.sched-week-label {
    font-weight: 700; font-size: .8rem; color: var(--gray-600);
    padding: .5rem .6rem; white-space: nowrap; position: relative;
}
.sched-now-dot {
    display: inline-block; width: 7px; height: 7px;
    background: var(--red); border-radius: 50%; margin-right: .3rem; vertical-align: middle;
}
.sched-date-label { font-size: .75rem; color: var(--gray-400); padding: .5rem .4rem; text-align: center; }
.sched-cell {
    text-align: center; padding: .45rem .3rem;
    font-size: .8rem; font-weight: 600;
}
.sched-opp { color: var(--gray-800); text-decoration: none; }
.sched-opp:hover { text-decoration: underline; color: var(--blue); }
.sched-result { font-size: .65rem; font-weight: 700; display: block; margin-top: .1rem; }
.sched-result-w { color: var(--green); }
.sched-result-l { color: var(--red); }
.sched-win { background: #f0fff4; }
.sched-loss { background: #fff5f5; }
.sched-bye { color: var(--gray-400); font-weight: 400; font-size: .75rem; }
.sched-empty { color: var(--gray-200); font-weight: 400; }
.sched-legend {
    display: flex; gap: 1.25rem; font-size: .8rem; color: var(--gray-600);
    margin-top: .5rem; flex-wrap: wrap;
}
.sched-legend-item { display: flex; align-items: center; gap: .35rem; }
.sched-pip { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--gray-200); }
.sched-pip-win { background: #f0fff4; border-color: #c6f6d5; }
.sched-pip-loss { background: #fff5f5; border-color: #fed7d7; }
.sched-pip-bye { background: var(--gray-100); }
.sched-pip-upcoming { background: var(--white); }

/* --- Nav cards (index page) --- */
.league-nav-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 1rem; margin-bottom: 2rem; }
.nav-card { display: block; color: inherit; }
.nav-card:hover { text-decoration: none; border-color: var(--red); }
.nav-card h3 { font-size: 1rem; margin-bottom: .25rem; }
.nav-card p { font-size: .85rem; color: var(--gray-600); }

/* --- News --- */
.news-post { border-bottom: 1px solid var(--gray-200); padding: 1.25rem 0; }
.news-post:last-child { border-bottom: none; }
.news-meta { font-size: .75rem; color: var(--gray-400); margin-bottom: .6rem; display: flex; align-items: center; gap: .75rem; }
.news-meta a { color: var(--gray-400); }
.news-meta a:hover { text-decoration: underline; }
.prose { line-height: 1.7; }
.prose h1,.prose h2,.prose h3 { margin-top: 1.25em; }
.prose ul,.prose ol { padding-left: 1.5rem; }
.prose li { margin: .25rem 0; }
.prose hr { border: none; border-top: 1px solid var(--gray-200); margin: 1.5rem 0; }

/* --- Alerts --- */
.alert-success { background: #d1fae5; border: 1px solid #6ee7b7; color: #065f46; }
.alert-error   { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
[data-theme="dark"] .alert-success { background: #1a2e23; border-color: #2f855a; color: #68d391; }
[data-theme="dark"] .alert-error   { background: #2d1a1a; border-color: var(--red-dark); color: #fc8181; }

/* --- Email verification banner (full-width, below navbar) --- */
.email-verify-banner {
    background: #fef3c7;
    border-bottom: 1px solid #fcd34d;
    padding: .6rem 1rem;
    text-align: center;
    font-size: .83rem;
    color: #92400e;
}
.email-verify-banner a { color: #b45309; font-weight: 600; margin-left: .5rem; }
[data-theme="dark"] .email-verify-banner { background: #2d2010; border-bottom-color: #744210; color: #f6d860; }
[data-theme="dark"] .email-verify-banner a { color: #fbbf24; }

/* --- League browser status pills --- */
.status-pill {
    font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; padding: .2rem .55rem; border-radius: 20px;
}
.status-setup    { background: #dbeafe; color: #1d4ed8; }
.status-drafting { background: #fef9c3; color: #92400e; }
.status-active   { background: #dcfce7; color: #166534; }
.status-playoffs { background: #f3e8ff; color: #6d28d9; }
.status-complete { background: var(--gray-100); color: var(--gray-600); }
[data-theme="dark"] .status-setup    { background: #1e3a5f; color: #90cdf4; }
[data-theme="dark"] .status-drafting { background: #2d2010; color: #f6d860; }
[data-theme="dark"] .status-active   { background: #1a2e23; color: #68d391; }
[data-theme="dark"] .status-playoffs { background: #2d1a4a; color: #b794f4; }

/* --- My Teams (/me) --- */
.my-team-card {
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius); padding: 1.25rem;
    margin-bottom: 1.5rem; box-shadow: var(--shadow);
}
.my-team-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 1rem; gap: 1rem; flex-wrap: wrap;
}
.my-team-name  { font-size: 1.1rem; font-weight: 700; margin: 0 0 .2rem; }
.my-team-meta  { font-size: .8rem; color: var(--gray-600); }
.my-section-label {
    display: block; font-size: .75rem; font-weight: 600;
    color: var(--gray-600); text-transform: uppercase;
    letter-spacing: .04em; margin-bottom: .5rem;
}
.my-queue-card {
    background: var(--gray-50); border: 1px solid var(--gray-200);
    border-radius: var(--radius); padding: .85rem 1rem; margin-bottom: .85rem;
}
.my-queue-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .35rem; }
.my-queue-title { font-weight: 600; font-size: .9rem; }
.my-queue-status { font-size: .85rem; color: var(--gray-600); margin: 0; }
.my-matches { margin-bottom: .85rem; }
.my-match-row {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--gray-50); border: 1px solid var(--gray-200);
    border-radius: var(--radius); padding: .5rem .75rem;
    margin-top: .4rem; gap: 1rem; flex-wrap: wrap;
}
.my-match-info  { display: flex; align-items: center; gap: .5rem; }
.my-match-week  { font-weight: 600; font-size: .9rem; }
.my-match-opp   { font-size: .85rem; color: var(--gray-600); }
.my-match-actions { display: flex; align-items: center; gap: .5rem; }
.badge-submitted { font-size: .75rem; font-weight: 600; color: #065f46; background: #d1fae5; border-radius: 3px; padding: .15rem .45rem; }
.my-match-pending { font-size: .8rem; color: var(--gray-500); }
.my-roster { margin-bottom: .85rem; }
.my-roster-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.my-roster-chip {
    display: flex; align-items: center; gap: .3rem;
    background: var(--gray-50); border: 1px solid var(--gray-200);
    border-radius: var(--radius); padding: .2rem .5rem; font-size: .8rem;
}
.my-roster-chip img { width: 24px; height: 24px; image-rendering: pixelated; }
.my-roster-empty { font-size: .85rem; color: var(--gray-500); margin-top: .4rem; }
.my-team-links  { font-size: .85rem; display: flex; align-items: center; gap: .5rem; padding-top: .25rem; border-top: 1px solid var(--gray-200); margin-top: .25rem; }
.link-sep       { color: var(--gray-400); }
[data-theme="dark"] .badge-submitted { background: #1a2e23; color: #68d391; }

/* --- Team Profile --- */
.team-banner {
    background: linear-gradient(135deg, #5a0e01 0%, #1a1a1a 100%);
    background-size: cover;
    background-position: center;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.team-banner-overlay {
    background: linear-gradient(to right, rgba(0,0,0,.65) 20%, rgba(0,0,0,.25) 100%);
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-height: 140px;
}
.team-banner-logo {
    width: 80px; height: 80px; object-fit: contain; flex-shrink: 0;
    border-radius: 8px; background: rgba(255,255,255,.12); padding: 4px;
}
.team-banner-info { color: #fff; }
.team-banner-info h1 { font-size: 2rem; font-weight: 800; margin-bottom: .2rem; line-height: 1.1; color: #fff; }
.team-banner-slogan { font-style: italic; opacity: .8; margin-bottom: .6rem; font-size: 1rem; }
.team-banner-meta { display: flex; gap: .6rem; flex-wrap: wrap; font-size: .82rem; }
.team-banner-stat { background: rgba(255,255,255,.18); border-radius: 6px; padding: .2rem .6rem; font-weight: 600; }

.featured-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.featured-card {
    background: var(--white); border: 2px solid var(--gray-200);
    border-radius: var(--radius); padding: .85rem .6rem;
    text-align: center; box-shadow: var(--shadow);
    transition: border-color .15s, box-shadow .15s;
}
.featured-card:hover { border-color: var(--red); box-shadow: 0 4px 16px rgba(229,62,62,.15); }
.featured-sprite { width: 80px; height: 80px; object-fit: contain; image-rendering: pixelated; display: block; margin: 0 auto; }
.featured-name { font-weight: 700; font-size: .9rem; margin-top: .5rem; }
.featured-types { display: flex; justify-content: center; gap: .25rem; flex-wrap: wrap; margin: .25rem 0; }
.featured-pts { font-size: .8rem; color: var(--gray-600); }

.results-list { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.5rem; }
.result-row {
    display: flex; align-items: center; gap: .75rem;
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius); padding: .55rem 1rem; font-size: .9rem;
}
.result-week { color: var(--gray-500); font-size: .8rem; min-width: 44px; }
.result-vs { flex: 1; }
.result-score { font-weight: 700; font-size: .85rem; min-width: 40px; text-align: right; }
.result-badge { padding: .15rem .5rem; border-radius: 99px; font-size: .72rem; font-weight: 700; min-width: 24px; text-align: center; }
.result-badge.win { background: var(--green); color: #fff; }
.result-badge.loss { background: var(--red); color: #fff; }
.result-badge.sched { background: var(--gray-200); color: var(--gray-600); }

.lineup-selected { border-color: var(--red) !important; background: rgba(229,62,62,.06) !important; }
[data-theme="dark"] .featured-card { background: var(--card-bg); border-color: var(--border); }
[data-theme="dark"] .featured-card:hover { box-shadow: 0 4px 16px rgba(26,122,62,.25); }
[data-theme="dark"] .lineup-selected { background: rgba(26,122,62,.1) !important; }
[data-theme="dark"] .result-row { background: var(--card-bg); border-color: var(--border); }
[data-theme="dark"] .team-banner-info h1 { color: #fff; }

/* Player Profile */
.player-team-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.player-team-card .team-banner { margin-bottom: 0; border-radius: 0; }
.player-featured-row {
    display: flex; align-items: center; gap: .75rem;
    padding: .65rem 1rem; flex-wrap: wrap;
    border-bottom: 1px solid var(--gray-100);
}
.player-featured-chip {
    display: flex; align-items: center; gap: .35rem;
    background: var(--gray-50); border: 1px solid var(--gray-200);
    border-radius: 99px; padding: .15rem .6rem .15rem .15rem;
    font-size: .82rem; font-weight: 500;
}
.player-featured-chip img { width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; }
[data-theme="dark"] .player-team-card { background: var(--card-bg); border-color: var(--border); }
[data-theme="dark"] .player-featured-chip { background: var(--gray-100); border-color: var(--gray-200); }

/* --- Mobile --- */
/* --- Mobile league nav (replaces sidebar on small screens) --- */
.league-mobile-nav { display: none; }

@media (max-width: 768px) {
    .league-sidebar { display: none; }
    .league-layout { grid-template-columns: 1fr; padding: .75rem; }
    .league-content { padding: 0; }

    /* Horizontal pill nav replaces sidebar */
    .league-mobile-nav {
        display: flex;
        gap: .35rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: .6rem .75rem;
        background: var(--white);
        border-bottom: 1px solid var(--gray-200);
        position: sticky;
        top: 48px;
        z-index: 50;
    }
    .league-mobile-nav::-webkit-scrollbar { display: none; }
    .league-mobile-nav a {
        flex-shrink: 0;
        padding: .35rem .8rem;
        border-radius: 99px;
        font-family: var(--font-display);
        font-size: .82rem;
        font-weight: 500;
        color: var(--gray-700);
        background: var(--gray-100);
        white-space: nowrap;
        text-decoration: none;
        border: 1px solid transparent;
    }
    .league-mobile-nav a:hover { background: var(--gray-200); text-decoration: none; }
    .league-mobile-nav a.sidebar-active {
        background: var(--red); color: #fff; border-color: var(--red-dark);
    }

    /* Table scroll shadow hint */
    .roster-all-wrap,
    .sched-grid-wrap {
        box-shadow: inset -12px 0 10px -10px rgba(0,0,0,.12);
        border-radius: 0 var(--radius) var(--radius) 0;
    }

    /* Touch targets for interactive elements */
    .btn-sm { min-height: 40px; padding: .45rem .75rem; }
    .my-match-actions .btn-sm { min-height: 40px; }
}

@media (max-width: 640px) {
    .container { padding: 1rem .75rem; }
    .nav-inner { padding: .35rem .75rem; gap: 0; }
    .nav-left { display: none; }
    .nav-links { gap: .5rem; flex-wrap: wrap; }
    .nav-links a { font-size: .8rem; }
    .page-header h1 { font-size: 1.35rem; }
    .on-clock-banner { gap: .5rem; }
    .on-clock-pick { margin-left: 0; }
    .roster-meta { gap: .75rem; }
    .roster-grid { grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: .75rem; }
    .roster-sprite { width: 60px; height: 60px; }
    .standings-table .stat-pf, .standings-table .stat-pa { display: none; }
    th[title="Points for"], th[title="Points against"] { display: none; }
    .pick-sprite { width: 44px; height: 44px; }
    .draft-board th { width: 90px; min-width: 80px; max-width: 110px; }
    /* Stack page-header on very small screens */
    .page-header { flex-direction: column; align-items: flex-start; gap: .4rem; }
    /* My teams match rows stack on small screens */
    .my-match-row { flex-direction: column; align-items: flex-start; }
    .my-match-actions { width: 100%; justify-content: flex-end; }
    /* Tray moves go single column on small screens */
    .tray-moves { grid-template-columns: 1fr; }
}

/* ── Guided Tour ──────────────────────────────────────────────── */
.tour-tooltip {
    position: fixed; z-index: 9999;
    background: var(--white); color: var(--text);
    border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,.22);
    padding: 1.1rem 1.25rem; max-width: 300px; min-width: 220px;
    font-size: .875rem; line-height: 1.5;
    border: 1px solid var(--gray-200);
}
.tour-tooltip-title { font-weight: 700; font-size: .95rem; margin-bottom: .35rem; color: var(--text); }
.tour-tooltip-body { color: var(--gray-600); margin-bottom: .9rem; font-size: .85rem; }
.tour-tooltip-footer { display: flex; align-items: center; justify-content: space-between; }
.tour-step-count { font-size: .75rem; color: var(--gray-400); }
.tour-close {
    position: absolute; top: .4rem; right: .5rem;
    background: none; border: none; cursor: pointer;
    color: var(--gray-400); font-size: 1.1rem; line-height: 1;
    padding: .15rem .35rem; border-radius: 3px;
}
.tour-close:hover { color: var(--gray-800); background: var(--gray-100); }
.tour-highlight {
    outline: 3px solid var(--red) !important;
    outline-offset: 4px;
    border-radius: 4px;
}
.tour-help-btn {
    position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 900;
    width: 2.25rem; height: 2.25rem; border-radius: 50%;
    background: var(--red); color: #fff; border: none; cursor: pointer;
    font-size: .95rem; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.2);
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, transform .15s;
}
.tour-help-btn:hover { background: var(--red-dark); transform: scale(1.08); }

/* ── Help Page ────────────────────────────────────────────────── */
.help-layout {
    display: grid; grid-template-columns: 180px 1fr;
    gap: 2.5rem; align-items: start; max-width: 960px;
}
.help-toc {
    position: sticky; top: 4.5rem;
    border: 1px solid var(--gray-200); border-radius: var(--radius);
    padding: 1rem; background: var(--white);
}
.help-toc-title {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--gray-400); margin-bottom: .6rem; padding-left: .5rem;
}
.help-toc a {
    display: block; padding: .3rem .5rem; font-size: .85rem;
    color: var(--gray-600); border-left: 2px solid transparent;
    text-decoration: none; border-radius: 0 3px 3px 0;
}
.help-toc a:hover { color: var(--red); border-color: var(--red); background: var(--gray-50); }
.help-toc a.help-toc-sub { font-size: .8rem; padding-left: 1rem; color: var(--gray-400); }
.help-content section { margin-bottom: 2.5rem; scroll-margin-top: 5rem; }
.help-content h2 {
    font-size: 1.3rem; margin: 0 0 1rem;
    padding-bottom: .5rem; border-bottom: 2px solid var(--gray-200);
}
.help-content h3 { font-size: 1rem; margin: 1.25rem 0 .4rem; color: var(--gray-800); }
.help-content p { margin: 0 0 .75rem; line-height: 1.7; color: var(--gray-700); font-size: .9rem; }
.help-content ul { margin: 0 0 .75rem; padding-left: 1.25rem; }
.help-content li { margin: .2rem 0; line-height: 1.6; color: var(--gray-700); font-size: .9rem; }
.help-note {
    background: var(--gray-50); border-left: 3px solid var(--blue);
    padding: .75rem 1rem; border-radius: 0 var(--radius) var(--radius) 0;
    font-size: .85rem; color: var(--gray-700); margin-bottom: 1rem;
}
.cmd-table { width: 100%; border-collapse: collapse; font-size: .875rem; margin-bottom: 1.5rem; }
.cmd-table th {
    text-align: left; padding: .5rem .75rem;
    background: var(--gray-50); font-size: .72rem;
    text-transform: uppercase; letter-spacing: .04em; color: var(--gray-500);
    border-bottom: 2px solid var(--gray-200);
}
.cmd-table td { padding: .55rem .75rem; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
.cmd-table tr:last-child td { border-bottom: none; }
.cmd-name {
    font-family: monospace; background: var(--gray-100);
    padding: .1rem .35rem; border-radius: 3px; font-size: .82rem; white-space: nowrap;
}
.cmd-badge {
    display: inline-block; font-size: .68rem; padding: .1rem .4rem;
    border-radius: 99px; font-weight: 600; white-space: nowrap;
}
.cmd-badge-mod { background: #dbeafe; color: #1e40af; }
.cmd-badge-admin { background: #fee2e2; color: #991b1b; }
[data-theme="dark"] .cmd-badge-mod { background: #1e3a5f; color: #90cdf4; }
[data-theme="dark"] .cmd-badge-admin { background: #2d1a1a; color: #f87171; }
[data-theme="dark"] .help-toc { background: var(--white); border-color: var(--gray-200); }
[data-theme="dark"] .help-note { background: var(--gray-100); border-color: #3b82f6; }
[data-theme="dark"] .cmd-table th { background: var(--gray-100); }
[data-theme="dark"] .cmd-table td { border-color: var(--gray-200); }
[data-theme="dark"] .cmd-name { background: var(--gray-200); color: var(--gray-800); }
@media (max-width: 720px) {
    .help-layout { grid-template-columns: 1fr; }
    .help-toc { position: static; display: flex; flex-wrap: wrap; gap: .35rem; padding: .75rem; }
    .help-toc-title { width: 100%; margin-bottom: .2rem; }
    .help-toc a { padding: .25rem .6rem; background: var(--gray-100); border-radius: 99px; border-left: none; font-size: .8rem; }
    .help-toc a:hover { background: var(--gray-200); }
    .help-toc a.help-toc-sub { display: none; }
}

/* ── Plan 09: Pokemon identity polish ────────────────────────── */

/* Pokeball mascot SVG - tinted via currentColor */
.pokeball {
    display: inline-block;
    width: var(--space-6);
    height: var(--space-6);
    color: var(--red);
    vertical-align: middle;
}
.pokeball-lg { width: var(--space-7); height: var(--space-7); }
.pokeball-sm { width: var(--space-5); height: var(--space-5); }

@keyframes pokeball-spin {
    to { transform: rotate(360deg); }
}
.pokeball.spinning {
    animation: pokeball-spin 1s linear infinite;
}

/* Empty-state mascot block */
.empty-state .pokeball {
    display: block;
    margin: 0 auto var(--space-3);
    color: var(--gray-400);
}

/* Section divider with pokeball */
.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin: var(--space-5) 0;
    color: var(--gray-300);
}
.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Type-color left border accent on cards */
.card-type-accent {
    position: relative;
    padding-left: var(--space-4);
}
.card-type-accent::before {
    content: "";
    position: absolute;
    top: var(--space-3);
    bottom: var(--space-3);
    left: 0;
    width: 4px;
    border-radius: var(--radius-full);
    background: var(--card-accent-color, var(--gray-400));
}

.card-type-accent.type-fire     { --card-accent-color: var(--type-fire); }
.card-type-accent.type-water    { --card-accent-color: var(--type-water); }
.card-type-accent.type-grass    { --card-accent-color: var(--type-grass); }
.card-type-accent.type-electric { --card-accent-color: var(--type-electric); }
.card-type-accent.type-psychic  { --card-accent-color: var(--type-psychic); }
.card-type-accent.type-fighting { --card-accent-color: var(--type-fighting); }
.card-type-accent.type-poison   { --card-accent-color: var(--type-poison); }
.card-type-accent.type-ground   { --card-accent-color: var(--type-ground); }
.card-type-accent.type-flying   { --card-accent-color: var(--type-flying); }
.card-type-accent.type-bug      { --card-accent-color: var(--type-bug); }
.card-type-accent.type-rock     { --card-accent-color: var(--type-rock); }
.card-type-accent.type-ghost    { --card-accent-color: var(--type-ghost); }
.card-type-accent.type-dragon   { --card-accent-color: var(--type-dragon); }
.card-type-accent.type-dark     { --card-accent-color: var(--type-dark); }
.card-type-accent.type-steel    { --card-accent-color: var(--type-steel); }
.card-type-accent.type-fairy    { --card-accent-color: var(--type-fairy); }
.card-type-accent.type-ice      { --card-accent-color: var(--type-ice); }
.card-type-accent.type-normal   { --card-accent-color: var(--type-normal); }

/* Sprite hover treatment */
.roster-sprite,
.featured-sprite,
.pick-sprite,
.sprite {
    image-rendering: pixelated;
    transition: transform var(--duration-base) var(--ease-out),
                filter var(--duration-base) var(--ease-out);
}
.roster-card:hover .roster-sprite,
.featured-card:hover .featured-sprite,
.pool-card:hover .roster-sprite,
.card:hover .sprite,
.pokemon-card:hover .sprite {
    transform: scale(1.08) translateY(-2px);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* On-the-clock pulsing banner (signature element) */
.on-clock-pulse {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    background: linear-gradient(90deg, var(--red), var(--red-dark));
    color: var(--text-inverse);
    border-radius: var(--radius-md);
    font-weight: var(--weight-semibold);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    margin-bottom: var(--space-4);
}

.on-clock-pulse::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top right, rgba(255,255,255,0.2), transparent 60%);
    pointer-events: none;
}

.on-clock-pulse .pokeball {
    color: var(--text-inverse);
    flex-shrink: 0;
}

@keyframes clock-pulse {
    0%, 100% { box-shadow: var(--shadow-lg), 0 0 0 0 rgba(171,24,2,0.4); }
    50%      { box-shadow: var(--shadow-lg), 0 0 0 8px rgba(171,24,2,0); }
}

.on-clock-pulse.pulsing {
    animation: clock-pulse 2s ease-in-out infinite;
}

/* Live-draft: a freshly-arrived pick gets a brief glow + scale-in pop so
 * users tracking the board see exactly which slot just filled. */
@keyframes pick-just-arrived {
    0%   { transform: scale(.85); box-shadow: 0 0 0 0 rgba(217, 119, 6, .55); }
    35%  { transform: scale(1.04); box-shadow: 0 0 0 6px rgba(217, 119, 6, .25); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(217, 119, 6, 0); }
}
.pick-cell.pick-just-arrived {
    animation: pick-just-arrived .85s cubic-bezier(.2,.7,.2,1);
}
@media (prefers-reduced-motion: reduce) {
    .pick-cell.pick-just-arrived { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
    .on-clock-pulse.pulsing { animation: none; }
}

/* Pending-action panel on the Roster Dashboard */
.pending-actions-panel {
    background: var(--card-bg, #fff);
    border: 1.5px solid var(--red);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-pop);
}
.pending-actions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}
.pending-actions-title {
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: .8rem;
    color: var(--red);
}
.pending-actions-count {
    background: var(--red);
    color: var(--text-inverse);
    border-radius: 99px;
    padding: 2px 10px;
    font-size: .75rem;
    font-weight: var(--weight-bold);
}
.pending-actions-list { list-style: none; padding: 0; margin: 0; }
.pending-action-item { margin-bottom: var(--space-2); }
.pending-action-item:last-child { margin-bottom: 0; }
.pending-action-item a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    color: var(--text);
    text-decoration: none;
    background: var(--input-bg, #f9fafb);
    border-left: 4px solid var(--gray-300);
}
.pending-action-item.urgency-high a {
    border-left-color: var(--red);
    background: rgba(171,24,2,0.06);
}
.pending-action-item a:hover {
    background: var(--gray-100);
}
.pending-action-item.urgency-high a:hover {
    background: rgba(171,24,2,0.12);
}
.pending-action-pip {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--gray-400);
    flex-shrink: 0;
}
.pending-action-item.urgency-high .pending-action-pip {
    background: var(--red);
}
.pending-action-msg { flex: 1; font-weight: var(--weight-medium); }
.pending-action-arrow { color: var(--gray-400); }

/* Pending-action marquee: site-wide call-to-action banner */
.pending-marquee {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-5);
    background: linear-gradient(90deg, var(--red), var(--red-dark));
    color: var(--text-inverse);
    font-weight: var(--weight-semibold);
    font-size: .9rem;
    border-bottom: 2px solid rgba(0,0,0,0.15);
    text-align: center;
}
.pending-marquee[hidden] { display: none; }
.pending-marquee a {
    color: var(--text-inverse);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}
.pending-marquee a:hover { text-decoration: underline; }
.pending-marquee::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.85);
    flex-shrink: 0;
}
@keyframes marquee-pulse {
    0%, 100% { box-shadow: inset 0 0 0 0 rgba(255,255,255,0); }
    50%      { box-shadow: inset 0 0 30px 0 rgba(255,255,255,0.18); }
}
.pending-marquee.pulsing {
    animation: marquee-pulse 1.6s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
    .pending-marquee.pulsing { animation: none; }
}

/* Lucide-style icons (replacing emoji glyphs) */
.icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    flex-shrink: 0;
    vertical-align: middle;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

/* Theme toggle: pokeball in light mode, dusk ball in dark mode (custom pixel art) */
.theme-ball {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}
/* Plan 11: show the OPPOSITE-mode ball as the toggle indicator (click target preview).
   In light mode you see the dusk ball (click -> go dark). In dark mode you see the
   pokeball (click -> go light). */
.dark-toggle .theme-ball-light { display: none; }
.dark-toggle .theme-ball-dark  { display: inline-block; }
[data-theme="dark"] .dark-toggle .theme-ball-light { display: inline-block; }
[data-theme="dark"] .dark-toggle .theme-ball-dark  { display: none; }

/* Type filter chips on pool page */
.type-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.chip {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.chip[aria-pressed="true"] {
    background: var(--card-accent-color, var(--red));
    color: var(--text-inverse);
    border-color: var(--card-accent-color, var(--red));
}

.chip:hover {
    border-color: var(--card-accent-color, var(--red));
}

.chip.chip-type.type-fire     { --card-accent-color: var(--type-fire); }
.chip.chip-type.type-water    { --card-accent-color: var(--type-water); }
.chip.chip-type.type-grass    { --card-accent-color: var(--type-grass); }
.chip.chip-type.type-electric { --card-accent-color: var(--type-electric); }
.chip.chip-type.type-psychic  { --card-accent-color: var(--type-psychic); }
.chip.chip-type.type-fighting { --card-accent-color: var(--type-fighting); }
.chip.chip-type.type-poison   { --card-accent-color: var(--type-poison); }
.chip.chip-type.type-ground   { --card-accent-color: var(--type-ground); }
.chip.chip-type.type-flying   { --card-accent-color: var(--type-flying); }
.chip.chip-type.type-bug      { --card-accent-color: var(--type-bug); }
.chip.chip-type.type-rock     { --card-accent-color: var(--type-rock); }
.chip.chip-type.type-ghost    { --card-accent-color: var(--type-ghost); }
.chip.chip-type.type-dragon   { --card-accent-color: var(--type-dragon); }
.chip.chip-type.type-dark     { --card-accent-color: var(--type-dark); }
.chip.chip-type.type-steel    { --card-accent-color: var(--type-steel); }
.chip.chip-type.type-fairy    { --card-accent-color: var(--type-fairy); }
.chip.chip-type.type-ice      { --card-accent-color: var(--type-ice); }
.chip.chip-type.type-normal   { --card-accent-color: var(--type-normal); }

/* ============================================================
   Plan 11 - Pixel-retro identity component overrides
   Token shifts (radius, shadow, font) live in :root above; this
   block applies them to the existing component selectors.
   ============================================================ */

/* --- Display font on UI chrome (h1-h6 already done at line ~256) --- */
.nav-brand,
.nav-left a,
.nav-links a,
.nav-dropdown-btn,
.btn,
.badge,
.chip,
.section-title,
.team-name,
.team-banner-name,
.league-name,
.league-sidebar-title,
.league-sidebar nav a,
.league-mobile-nav a,
.standings-table th,
.feed-section-title,
.on-clock-label,
.on-clock-team,
.on-clock-pick,
.pokemon-name,
.featured-name,
.my-team-name,
.my-section-label,
.tab-btn,
.subtitle {
    font-family: var(--font-display);
}

/* --- Tabular numerals on numeric data --- */
.score, .pokemon-pts, .featured-pts,
.pick-mini-pts, .pick-num, .pick-number,
.stat-value,
.team-banner-stat,
.standings-table td.numeric,
.score-badge,
.pts-bar-num,
.match-row .score,
.feed-meta {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* --- Type-brand fallback for non-Pokemon entities --- */
.card-type-accent.type-brand { --card-accent-color: var(--red); }
.feed-item.type-brand,
.feed-item.type-news { border-left-color: var(--red); }

/* Plan 11: card-type-accent bar reshape - 6px flat block, extends nearer to edges */
.card-type-accent { padding-left: var(--space-5); }
.card-type-accent::before {
    top: var(--space-2);
    bottom: var(--space-2);
    width: 6px;
    border-radius: 0;
}

/* --- Plan 11 round 2: pool card horizontal layout (sprite-left, info-right) --- */
.roster-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-3); }
.roster-card.pool-card {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: var(--space-3);
    padding: var(--space-3);
    padding-left: var(--space-5);
}
.roster-card.pool-card .roster-sprite {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}
.roster-card.pool-card .roster-card-info {
    margin-top: 0;
    flex: 1;
    min-width: 0;
    text-align: left;
    gap: var(--space-1);
}
.roster-card.pool-card .pokemon-types { justify-content: flex-start; }
.roster-card.pool-card .pokemon-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Plan 11 round 2: roster page card upgrade (framed sprite + bigger name + stats row) --- */
/* Only applies to the roster page (.roster-card without .pool-card modifier and without
   the .roster-grid-sm tight grid override). */
.roster-grid:not(.roster-grid-sm) .roster-card:not(.pool-card) {
    padding: var(--space-3);
    padding-left: var(--space-5);
    gap: var(--space-2);
}
.roster-grid:not(.roster-grid-sm) .roster-card:not(.pool-card) .roster-sprite {
    width: 100%;
    max-width: 120px;
    height: 96px;
    object-fit: contain;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--space-2);
    box-sizing: border-box;
}
.roster-grid:not(.roster-grid-sm) .roster-card:not(.pool-card) .roster-card-info {
    width: 100%;
    align-items: center;
    margin-top: var(--space-1);
}
.roster-grid:not(.roster-grid-sm) .roster-card:not(.pool-card) .pokemon-name {
    font-family: var(--font-display);
    font-size: var(--text-base);
    letter-spacing: 0.01em;
}
.roster-grid:not(.roster-grid-sm) .roster-card:not(.pool-card) .pokemon-pts {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: var(--text-sm);
}

/* --- Plan 11 round 2: hero wordmark image instead of giant text --- */
.hero-pixel-wordmark {
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    width: clamp(280px, 50vw, 480px);
    height: auto;
    margin: 0 0 var(--space-4);
    /* Pop with the same hard-offset shadow used elsewhere */
    filter: drop-shadow(4px 4px 0 var(--red-dark));
}

/* --- Plan 11 round 2: nav link breathing room (matches mockup proportions) --- */
.nav-left a, .nav-links a {
    padding: var(--space-3) var(--space-3);
    font-size: var(--text-base);
}

/* --- PCCBL nav-brand: Jersey 15 only (Pixelify C looks like O in PCCBL) --- */
.nav-brand {
    font-family: var(--font-display-sm);
    font-size: var(--text-2xl);
    font-weight: var(--weight-normal); /* Jersey 15 ships only one weight */
    letter-spacing: 0.04em;
    color: #ffffff;
    padding: var(--space-3) var(--space-4) var(--space-3) 0;
    line-height: 1;
}
.nav-brand:hover { color: rgba(255,255,255,.9); text-decoration: none; }
/* Override the generic [data-theme="dark"] a { color: #60a5fa } that would
   otherwise turn the nav-brand blue in dark mode. */
[data-theme="dark"] .nav-brand,
[data-theme="dark"] .nav-brand:hover { color: #ffffff; }

/* Pixelify Sans heading line-height */
h1, h2, h3 { line-height: 1.1; }
h4, h5, h6 { line-height: 1.2; }

/* Small display contexts: section card headers, table column labels, stat labels */
.section-card-header h2,
.section-card-header h3,
.standings-table th,
.league-sidebar-header .badge { font-family: var(--font-display-sm); }

/* Sidebar: no border-top on first nav link */
.league-sidebar nav a:first-child { border-top: none; }

/* --- Plan 11 r3: /me page text colors fixed for both themes --- */
.my-team-card { color: var(--text); }
.my-team-name { color: var(--text); }
.my-team-meta { color: var(--text-secondary); }
.my-section-label { color: var(--text-secondary); }
.my-match-week { color: var(--text); }
.my-match-opp { color: var(--text-secondary); }
.my-match-pending { color: var(--text-tertiary); }
.my-queue-title { color: var(--text); }
.my-queue-status { color: var(--text-secondary); }
.my-roster-chip { color: var(--text); }
.my-roster-empty { color: var(--text-secondary); }
.my-team-links a { color: var(--text-secondary); }
.my-team-links a:hover { color: var(--red); }

/* --- Plan 11 r6: optional banner strip above the team header (only renders when team.banner_url is set) --- */
.team-banner-strip {
    height: clamp(110px, 18vw, 180px);
    background-size: cover;
    background-position: center;
    background-color: var(--bg-alt);
    border: 2px solid var(--gray-900);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    box-shadow: var(--shadow-md);
    position: relative;
    margin-bottom: 0;
}
[data-theme="dark"] .team-banner-strip { border-color: #f0f0f0; }
.team-banner-strip::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.35) 100%);
    pointer-events: none;
    border-radius: inherit;
}
/* When the strip is rendered, the header card flows seamlessly below it */
.team-header-pixel.has-banner {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: none;
    margin-top: 0;
}

/* --- Plan 11 r3: clean team header (replaces .team-banner overlay style) --- */
.team-header-pixel {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: var(--surface);
    border: 2px solid var(--gray-900);
    border-left: 8px solid var(--card-accent-color, var(--red));
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-pop);
    margin-bottom: var(--space-4);
}
[data-theme="dark"] .team-header-pixel { border-color: #f0f0f0; border-left-color: var(--card-accent-color, var(--red)); }

/* Team header borrows the type-X mapping used elsewhere */
.team-header-pixel.type-fire     { --card-accent-color: var(--type-fire); }
.team-header-pixel.type-water    { --card-accent-color: var(--type-water); }
.team-header-pixel.type-grass    { --card-accent-color: var(--type-grass); }
.team-header-pixel.type-electric { --card-accent-color: var(--type-electric); }
.team-header-pixel.type-psychic  { --card-accent-color: var(--type-psychic); }
.team-header-pixel.type-fighting { --card-accent-color: var(--type-fighting); }
.team-header-pixel.type-poison   { --card-accent-color: var(--type-poison); }
.team-header-pixel.type-ground   { --card-accent-color: var(--type-ground); }
.team-header-pixel.type-flying   { --card-accent-color: var(--type-flying); }
.team-header-pixel.type-bug      { --card-accent-color: var(--type-bug); }
.team-header-pixel.type-rock     { --card-accent-color: var(--type-rock); }
.team-header-pixel.type-ghost    { --card-accent-color: var(--type-ghost); }
.team-header-pixel.type-dragon   { --card-accent-color: var(--type-dragon); }
.team-header-pixel.type-dark     { --card-accent-color: var(--type-dark); }
.team-header-pixel.type-steel    { --card-accent-color: var(--type-steel); }
.team-header-pixel.type-fairy    { --card-accent-color: var(--type-fairy); }
.team-header-pixel.type-ice      { --card-accent-color: var(--type-ice); }
.team-header-pixel.type-normal   { --card-accent-color: var(--type-normal); }
.team-header-pixel.type-brand    { --card-accent-color: var(--red); }

.team-header-logo {
    width: 80px;
    height: 80px;
    border: 2px solid var(--gray-900);
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--card-accent-color, var(--red)), color-mix(in srgb, var(--card-accent-color, var(--red)) 50%, var(--gray-900)));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
[data-theme="dark"] .team-header-logo { border-color: #f0f0f0; }
.team-header-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
}
.team-header-logo span {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--weight-extrabold);
    color: #ffffff;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
    letter-spacing: 0.04em;
}

.team-header-info { min-width: 0; }
.team-header-name {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    margin: 0 0 var(--space-1);
    line-height: 1.1;
    letter-spacing: 0.01em;
    color: var(--text);
}
.team-header-meta {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: baseline;
}
.team-header-meta .dot { color: var(--text-tertiary); }
.team-header-meta .slogan { font-style: italic; color: var(--text-tertiary); }

.team-header-record {
    text-align: right;
    white-space: nowrap;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: var(--space-3);
    border-left: 2px solid var(--border);
}
.team-header-record .label {
    font-family: var(--font-display);
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-1);
}
.team-header-record .value {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: var(--text-2xl);
    color: var(--text);
}
.team-header-record .value strong { color: var(--red); }
.team-header-record .rank {
    font-size: var(--text-base);
    color: var(--text-tertiary);
    font-weight: normal;
}

@media (max-width: 720px) {
    .team-header-pixel { grid-template-columns: auto 1fr; }
    .team-header-record {
        grid-column: 1 / -1;
        text-align: left;
        border-left: none;
        border-top: 1px solid var(--border);
        padding-left: 0;
        padding-top: var(--space-2);
        flex-direction: row;
        gap: var(--space-3);
        align-items: baseline;
    }
}

/* --- Plan 11 r3: team summary stat cards (Points / Roster / FA) --- */
.team-summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}
@media (max-width: 720px) { .team-summary-stats { grid-template-columns: 1fr; } }

.team-summary-stats .summary-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}
.team-summary-stats .summary-pokeball {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    image-rendering: pixelated;
}
.team-summary-stats .label {
    font-family: var(--font-display);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}
.team-summary-stats .value {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: var(--text-2xl);
    color: var(--text);
    line-height: 1.1;
}
.team-summary-stats .value strong { color: var(--red); }

/* --- Navbar: rectangular, hard-edge bottom border --- */
.navbar {
    border-bottom: 4px solid var(--red-dark);
    box-shadow: none;
}
.nav-links a {
    border-radius: 0;
    padding: var(--space-2) var(--space-3);
    border-bottom: 2px solid transparent;
    line-height: 1.4;
    letter-spacing: 0.01em;
}
.nav-links a:hover {
    border-bottom-color: rgba(255,255,255,.7);
    text-decoration: none;
}
.nav-admin {
    border-radius: 0;
    background: rgba(0,0,0,.25);
    border-bottom: 2px solid transparent;
}
.nav-admin:hover { border-bottom-color: rgba(255,255,255,.7); }
.nav-dropdown-btn { border-radius: 0; }

/* --- League sidebar: signature gradient echo on active --- */
.league-sidebar nav a.sidebar-active {
    background: linear-gradient(90deg, var(--red), var(--red-dark));
    color: #ffffff;
    border-left: 4px solid var(--gray-900);
    font-weight: var(--weight-semibold);
    box-shadow: var(--shadow-md);
}
[data-theme="dark"] .league-sidebar nav a.sidebar-active {
    color: #ffffff;
    background: linear-gradient(90deg, var(--red), var(--red-dark));
    border-left-color: #f0f0f0;
}
.league-mobile-nav a.sidebar-active {
    background: linear-gradient(90deg, var(--red), var(--red-dark));
    color: #ffffff !important;
}
[data-theme="dark"] .league-mobile-nav a.sidebar-active { color: #ffffff !important; }

/* --- On-clock banner: amplify with pop shadow --- */
.on-clock-banner {
    box-shadow: var(--shadow-pop);
    border-width: 2px;
}

/* --- Cards: hard-offset hover lift, no blue border --- */
.card:hover {
    border-color: var(--gray-400);
    transform: translate(-1px, -1px);
    box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .card:hover {
    border-color: var(--gray-600);
}

/* --- Buttons: hard-offset shadow + lift hover --- */
.btn {
    box-shadow: var(--shadow-sm);
    transition: transform var(--duration-fast), box-shadow var(--duration-fast);
    letter-spacing: 0.01em;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translate(1px, 1px); box-shadow: var(--shadow-xs); }
.btn-primary { box-shadow: var(--shadow-pop); }
.btn-primary:hover { box-shadow: 5px 5px 0 var(--red-dark); transform: translate(-1px, -1px); }

/* --- Activity feed: de-carded flush rows with type-color left tick --- */
.feed {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.feed-item {
    display: block;
    padding: var(--space-3) var(--space-4);
    border-left: 6px solid var(--border);
    background: var(--surface);
    line-height: var(--leading-snug);
}
.feed-item + .feed-item { border-top: 1px solid var(--border); }
.feed-item.type-fire     { border-left-color: var(--type-fire); }
.feed-item.type-water    { border-left-color: var(--type-water); }
.feed-item.type-grass    { border-left-color: var(--type-grass); }
.feed-item.type-electric { border-left-color: var(--type-electric); }
.feed-item.type-psychic  { border-left-color: var(--type-psychic); }
.feed-item.type-fighting { border-left-color: var(--type-fighting); }
.feed-item.type-poison   { border-left-color: var(--type-poison); }
.feed-item.type-ground   { border-left-color: var(--type-ground); }
.feed-item.type-flying   { border-left-color: var(--type-flying); }
.feed-item.type-bug      { border-left-color: var(--type-bug); }
.feed-item.type-rock     { border-left-color: var(--type-rock); }
.feed-item.type-ghost    { border-left-color: var(--type-ghost); }
.feed-item.type-dragon   { border-left-color: var(--type-dragon); }
.feed-item.type-dark     { border-left-color: var(--type-dark); }
.feed-item.type-steel    { border-left-color: var(--type-steel); }
.feed-item.type-fairy    { border-left-color: var(--type-fairy); }
.feed-item.type-ice      { border-left-color: var(--type-ice); }
.feed-item.type-normal   { border-left-color: var(--type-normal); }
.feed-item .feed-meta {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: var(--space-1);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.feed-item .feed-result a { font-weight: var(--weight-bold); color: inherit; }
.feed-item .feed-result a:hover { color: var(--red); }

/* --- Hero (homepage Plan 11): asymmetric grid + rotated pokeball anchor --- */
.hero-pixel {
    position: relative;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    color: #ffffff;
    border-bottom: 6px solid var(--gray-900);
    overflow: hidden;
    margin: -2rem -1.5rem 2rem;
}
[data-theme="dark"] .hero-pixel { border-bottom-color: #f0f0f0; }
.hero-pixel-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: var(--space-7);
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-7) var(--space-5);
}
.hero-pixel-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 9vw, 5.5rem);
    font-weight: var(--weight-extrabold);
    line-height: 0.95;
    letter-spacing: 0.02em;
    margin: 0 0 var(--space-3);
    text-shadow: 4px 4px 0 var(--red-dark);
    color: #ffffff;
}
.hero-pixel-tagline {
    font-family: var(--font-body);
    font-size: var(--text-lg);
    opacity: 0.92;
    margin: 0 0 var(--space-5);
    max-width: none;
    line-height: var(--leading-snug);
    white-space: nowrap;
}
@media (max-width: 720px) {
    .hero-pixel-tagline { white-space: normal; }
}
.hero-pixel-cta { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.hero-pixel-cta .btn-ghost {
    background: transparent;
    border: 2px solid #ffffff;
    color: #ffffff;
    box-shadow: none;
}
.hero-pixel-cta .btn-ghost:hover { background: rgba(255,255,255,.12); box-shadow: none; }
.hero-pokeball-anchor {
    width: clamp(180px, 28vw, 360px);
    color: #ffffff;
    opacity: 0.22;
    transform: rotate(-12deg);
    margin-right: -8%;
    flex-shrink: 0;
}
.hero-pokeball-anchor svg { width: 100%; height: 100%; display: block; }
@media (max-width: 720px) {
    .hero-pixel-inner { grid-template-columns: 1fr; }
    .hero-pokeball-anchor { display: none; }
    .hero-pixel-title { text-shadow: 3px 3px 0 var(--red-dark); }
}

/* --- Section header: pokeball glyph + hard underline --- */
.section-header-pixel {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-6) 0 var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 3px solid var(--gray-900);
}
[data-theme="dark"] .section-header-pixel { border-bottom-color: #f0f0f0; }
.section-header-pixel h2 { flex: 1; margin: 0; }
.section-header-pixel .pokeball { color: var(--red); flex-shrink: 0; }

/* --- Sidebar (homepage active leagues) using card-type-accent pattern --- */
.sidebar-league.card-type-accent {
    padding-left: var(--space-4);
    position: relative;
}
.sidebar-league.card-type-accent::before {
    content: "";
    position: absolute;
    left: 0;
    top: var(--space-1);
    bottom: var(--space-1);
    width: 4px;
    background: var(--card-accent-color, var(--red));
}

/* ====================================================================
   Playoff bracket - mirrored layout (left + center + right)
   ==================================================================== */
.bracket-mirror {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-2) var(--space-4);
    overflow-x: auto;
    min-height: 280px;
}
.bracket-side {
    display: flex;
    align-items: stretch;
    flex: 0 0 auto;
}
.bracket-side.left { gap: var(--space-3); }
.bracket-side.right { gap: var(--space-3); flex-direction: row; }
.bracket-col {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    min-width: 220px;
    flex: 0 0 auto;
}
.bracket-col.center { min-width: 240px; justify-content: center; }
.bracket-col-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--gray-500);
    text-align: center;
    margin-bottom: var(--space-2);
    font-weight: 600;
}
.bracket-match {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: .5rem .65rem;
    margin: .35rem 0;
    box-shadow: 2px 2px 0 var(--gray-100);
    position: relative;
}
.bracket-match.complete { border-color: var(--green-300, #86efac); }
.bracket-match.final {
    border-width: 2px;
    border-color: var(--gold, #d4af37);
    background: linear-gradient(180deg, #fffceb 0%, #fff 60%);
    box-shadow: 3px 3px 0 #f3e8b5;
}
[data-theme="dark"] .bracket-match { background: var(--card-bg, #1e1e1e); }
[data-theme="dark"] .bracket-match.final { background: #2a2410; }
.bracket-match .match-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .68rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .35rem;
}
.bracket-slot {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .25rem 0;
    font-size: .88rem;
    min-height: 1.6rem;
}
.bracket-slot.winner { font-weight: 700; color: var(--green-700, #15803d); }
.bracket-slot .seed-pill {
    display: inline-block;
    min-width: 1.4rem;
    text-align: center;
    font-size: .68rem;
    font-weight: 700;
    color: var(--gray-600);
    background: var(--gray-100);
    border-radius: 999px;
    padding: 0 .35rem;
}
.bracket-slot .score {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
    color: var(--gray-700);
    font-weight: 600;
    font-size: .85rem;
}
.bracket-slot .tbd {
    color: var(--gray-400);
    font-style: italic;
    font-size: .82rem;
}
.bracket-divider {
    border: none;
    border-top: 1px solid var(--gray-100);
    margin: .15rem 0;
}
.bracket-date {
    font-size: .72rem;
    color: var(--gray-500);
    margin-top: .35rem;
    text-align: center;
}
.bracket-date.unset { color: var(--gray-400); font-style: italic; }
.bracket-matchup-link {
    display: block;
    margin-top: .35rem;
    text-align: center;
    font-size: .7rem;
    color: var(--red);
    text-decoration: none;
    font-family: var(--font-display, inherit);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.bracket-matchup-link:hover { text-decoration: underline; }
.bracket-empty-msg {
    text-align: center;
    color: var(--gray-500);
    padding: var(--space-4);
}

/* Connector lines between rounds. Each match in a non-leaf round has a thin
   horizontal stub on its outer edge (right for left side, left for right side)
   suggesting the path inward toward the final. Subtle - the layout itself
   does most of the work. */
.bracket-side.left .bracket-col:not(:last-child) .bracket-match::after,
.bracket-side.right .bracket-col:not(:first-child) .bracket-match::after {
    content: "";
    position: absolute;
    top: 50%;
    width: var(--space-3);
    height: 1px;
    background: var(--gray-300);
}
.bracket-side.left .bracket-col:not(:last-child) .bracket-match::after { right: calc(-1 * var(--space-3)); }
.bracket-side.right .bracket-col:not(:first-child) .bracket-match::after { left: calc(-1 * var(--space-3)); }

/* Admin date controls inside a match card */
.bracket-match-actions {
    margin-top: .45rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.bracket-match-actions form { display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; }
.bracket-match-actions input[type=date] { font-size: .75rem; padding: .15rem .3rem; }
.bracket-match-actions .btn-sm { font-size: .72rem; padding: .15rem .45rem; }

.bracket-round-dates {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: flex-end;
    margin-bottom: var(--space-3);
}
.bracket-round-dates form {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: .4rem .6rem;
}
.bracket-round-dates form label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--gray-500);
}
.bracket-round-dates form .row { display: flex; gap: .35rem; align-items: center; }

@media (max-width: 720px) {
    .bracket-mirror { flex-direction: column; align-items: stretch; }
    .bracket-side { flex-direction: column !important; }
    .bracket-col { min-width: 0; }
    .bracket-side.left .bracket-col:not(:last-child) .bracket-match::after,
    .bracket-side.right .bracket-col:not(:first-child) .bracket-match::after { display: none; }
}


/* ─────────────────────────────────────────────────────────────────
 * Interactivity polish: card lift, sprite micro-bob, focus rings.
 * Layered on top of existing card styles; only adds transitions
 * and hover/focus visuals. Honors prefers-reduced-motion.
 * ───────────────────────────────────────────────────────────────── */

.league-card,
.team-card,
.my-team-card,
.player-team-card,
.pool-card,
.pokemon-card,
.feed-item {
    transition: transform 180ms ease-out, box-shadow 180ms ease-out, border-color 180ms ease-out;
    will-change: transform;
}

.league-card:hover,
.team-card:hover,
.my-team-card:hover,
.player-team-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-pop, 4px 4px 0 var(--gray-900));
}

.pool-card:hover,
.pokemon-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
}

.feed-item:hover {
    background: var(--gray-50, rgba(0, 0, 0, .02));
}
[data-theme="dark"] .feed-item:hover {
    background: rgba(255, 255, 255, .03);
}

/* Sprite micro-bob on card hover. The existing rules at lines 1249-1251
 * already brighten/scale the sprite slightly; this layers a gentle
 * vertical bob over that. */
.pool-card .roster-sprite,
.pokemon-card .sprite,
.team-card img.team-logo,
.my-team-card img.team-logo {
    transition: transform 220ms cubic-bezier(.2,.7,.2,1);
}
.pool-card:hover .roster-sprite,
.pokemon-card:hover .sprite {
    transform: translateY(-2px);
}
.team-card:hover img.team-logo,
.my-team-card:hover img.team-logo {
    transform: translateY(-1px) rotate(-2deg);
}

/* Buttons: subtle press affordance on click for tactile feedback. */
.btn,
button.btn,
a.btn {
    transition: transform 90ms ease-out, box-shadow 120ms ease-out, background-color 120ms ease-out;
}
.btn:active {
    transform: translateY(1px);
}

/* Visible focus ring for keyboard users on every interactive surface
 * we just gave hover treatment to. */
.league-card:focus-visible,
.team-card:focus-visible,
.my-team-card:focus-visible,
.player-team-card:focus-visible,
.pool-card:focus-visible,
.pokemon-card:focus-visible,
.feed-item:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--red, #ab1802);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .league-card,
    .team-card,
    .my-team-card,
    .player-team-card,
    .pool-card,
    .pokemon-card,
    .feed-item,
    .pool-card .roster-sprite,
    .pokemon-card .sprite,
    .team-card img.team-logo,
    .my-team-card img.team-logo,
    .btn {
        transition: none;
    }
    .league-card:hover,
    .team-card:hover,
    .my-team-card:hover,
    .player-team-card:hover,
    .pool-card:hover,
    .pokemon-card:hover,
    .pool-card:hover .roster-sprite,
    .pokemon-card:hover .sprite,
    .team-card:hover img.team-logo,
    .my-team-card:hover img.team-logo {
        transform: none;
    }
}

/* --- League banner customize panel (visible to moderators only) --- */
.banner-customize {
    margin-bottom: 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    overflow: hidden;
}
.banner-customize > summary {
    padding: .6rem 1rem;
    cursor: pointer;
    list-style: none;
    font-family: var(--font-display-sm);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: .5rem;
    user-select: none;
}
.banner-customize > summary::-webkit-details-marker { display: none; }
.banner-customize > summary::before {
    content: "▸";
    font-size: .7rem;
    transition: transform .15s;
}
.banner-customize[open] > summary::before { transform: rotate(90deg); }
.banner-customize-form {
    padding: .75rem 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .75rem;
}
.banner-customize-form label {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    font-family: var(--font-display-sm);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-secondary);
}
.banner-customize-form input[type="color"] {
    width: 48px;
    height: 32px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px;
    cursor: pointer;
    background: var(--surface);
}
.banner-customize-form input[type="file"] {
    font-size: .82rem;
    color: var(--text);
}
