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

html {
    /* clip plutot que hidden : preserve position: sticky sur les descendants */
    overflow-x: clip;
    background: var(--color-background);
}
body {
    position: relative;
    font-family: var(--font-primary);
    font-size: var(--text-base);
    line-height: var(--line-height-normal);
    color: var(--color-text);
    background: transparent;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-height: 100vh;
}

/* Fond parchemin : grain de papier discret + halo lumineux en haut */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background-color: #e0d6bd;
    background-image:
        repeating-linear-gradient(0deg, rgba(60,50,30,.035) 0 2px, transparent 2px 6px),
        repeating-linear-gradient(90deg, rgba(60,50,30,.025) 0 2px, transparent 2px 7px),
        radial-gradient(900px 480px at 50% 0%, #ece3cd, #e0d6bd 72%, #d9cfb4 100%);
}

a { color: var(--color-accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--color-text); }

img { max-width: 100%; height: auto; display: block; }

/* Sprites Pokemon : rendu pixel-perfect (look GBA upscale) */
.card img,
.detail-header img,
.coming-soon-card img {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 800;
    line-height: var(--line-height-tight);
    color: var(--color-text);
    letter-spacing: -.01em;
}
/* Tailles calibrees pour Inter (echelle classique) */
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

/* ===== Layout ===== */
.container {
    width: 100%;
    max-width: 1400px;
    margin-inline: auto;
    padding-inline: 6rem;
}
@media (max-width: 1200px) {
    .container { padding-inline: 3rem; }
}
@media (max-width: 900px) {
    .container { padding-inline: 1.5rem; }
}
@media (max-width: 480px) {
    .container { padding-inline: 1rem; }
}

/* ===== Header / Nav =====
   Couleurs hardcodees (violet #6c5ce7 + turquoise #00cec9) pour que le
   header soit visuellement identique sur PokeMMO, Pokemon Champions,
   le chooser et /app/. L'identite rouge/jaune de PokeMMO reste dans
   le reste du site (boutons, badges, accents). */
.site-header {
    background: var(--color-secondary);
    position: sticky;
    top: 0;
    z-index: 100;
    /* Stabilise le header sticky pendant le scroll mobile (barre d'URL qui
       redimensionne le viewport) : couche de composition dédiée, anti-jitter
       sous-pixel. will-change:transform garde .site-header comme containing
       block du menu mobile (position:absolute). */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
/* Barre dégradée jaune (PokeMMO) → blanc → violet (Champions) pour signaler
   l'identité bi-jeu du site, identique au gradient du footer. */
.site-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        rgba(255, 203, 5, 0) 0%,
        rgba(255, 203, 5, .9) 30%,
        rgba(255, 255, 255, .9) 50%,
        rgba(108, 92, 231, .9) 70%,
        rgba(108, 92, 231, 0) 100%);
    pointer-events: none;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: .75rem;
}

/* Le logo conserve la police "retro" Press Start 2P pour preserver
   l'identite Pokemon. Reduction de la taille pour compenser la densite
   de la police pixel. */
.site-logo {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 400;
    color: #fff;
    display: flex;
    align-items: center;
    gap: .6rem;
    letter-spacing: -.01em;
}
.site-logo img {
    height: 46px;
    width: auto;
    max-width: 58vw;
    display: block;
}
.site-logo span { color: #ffcb05; }

.main-nav { display: flex; gap: .25rem; align-items: center; }
.main-nav a {
    color: var(--color-on-dark-muted);
    padding: .5rem .75rem;
    border-radius: 6px;
    font-size: .9rem;
    font-weight: var(--font-weight-medium);
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.main-nav a img.game-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 3px;
    flex-shrink: 0;
}
.main-nav a:hover,
.main-nav a.active {
    color: #fff;
    background: rgba(255,255,255,.08);
}

.lang-switcher {
    display: flex;
    gap: 2px;
    margin-left: .5rem;
    padding-left: .75rem;
}
.lang-btn {
    color: var(--color-on-dark-muted);
    padding: .35rem .5rem;
    border-radius: 4px;
    font-size: .8rem;
    font-weight: var(--font-weight-bold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
}
/* Indicateur de focus clavier (accessibilite WCAG 2.4.7) */
.main-nav a:focus-visible,
.nav-toggle:focus-visible,
.lang-btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}
.lang-btn.active {
    color: #fff;
    background: rgba(108, 92, 231, .25);
}

.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--color-on-dark);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ===== Main content ===== */
main {
    min-height: calc(100vh - 70px - 80px);
    padding: 2rem 0;
}

/* ===== Cards grid ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.card {
    background: linear-gradient(180deg, var(--color-surface-elevated) 0%, var(--color-surface) 100%);
    border: 1px solid rgba(0,0,0,.10);
    border-radius: 12px;
    padding: 1.4rem 1rem 1.1rem;
    transition: transform .2s, border-color .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
    box-shadow: 0 10px 22px -12px rgba(20,18,15,.45);
}
.card-dex-number {
    position: absolute;
    top: .5rem;
    right: .6rem;
    font-size: .9rem;
    font-weight: 700;
    color: var(--color-text-light);
    opacity: .6;
}

.card img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    image-rendering: pixelated;
    margin-bottom: .5rem;
}
.card img.card-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    image-rendering: auto;
    border-radius: 6px;
}

.card .card-name {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-text);
    font-size: .95rem;
    line-height: 1.35;
    word-break: break-word;
}

.card .card-sub {
    color: var(--color-text-light);
    font-size: .85rem;
    margin-top: .25rem;
}

/* ===== Type badges ===== */
.type-badge {
    display: inline-block;
    padding: .15rem .6rem;
    border-radius: 4px;
    font-size: .75rem;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    color: #fff;
    letter-spacing: .03em;
}

.type-normal    { background: #9099a1; }
.type-fire      { background: #ff612c; }
.type-water     { background: #2c8cff; }
.type-grass     { background: #3fa129; }
.type-electric  { background: #fac100; color: #1a1a2e; }
.type-ice       { background: #47c8c8; }
.type-fighting  { background: #ff8000; }
.type-poison    { background: #9141cb; }
.type-ground    { background: #915121; }
.type-flying    { background: #78a2ff; }
.type-psychic   { background: #ef3f7a; }
.type-bug       { background: #91a119; }
.type-rock      { background: #afa981; }
.type-ghost     { background: #704170; }
.type-dragon    { background: #5060e0; }
.type-dark      { background: #50413f; }
.type-steel     { background: #60a0b0; }
.type-fairy     { background: #ee99ac; color: #1a1a2e; }

/* ===== Tables ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border-radius: 10px;
    overflow: hidden;
}
.data-table th {
    background: rgba(0,0,0,.05);
    padding: .65rem .9rem;
    text-align: left;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-text-light);
    font-family: var(--font-heading);
}
.data-table td {
    padding: .5rem .9rem;
    border-top: 1px solid rgba(0,0,0,.04);
    font-size: 1.05rem;
}
.data-table tr:hover td {
    background: rgba(0,0,0,.02);
}

/* ===== Stat bars ===== */
.stat-bar-wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.stat-label {
    width: 70px;
    font-size: .85rem;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-light);
    text-align: right;
}
.stat-bar {
    flex: 1;
    height: 10px;
    background: rgba(0,0,0,.08);
    border-radius: 5px;
    overflow: hidden;
}
.stat-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width .6s ease;
}
.stat-value {
    width: 35px;
    font-size: .85rem;
    font-weight: var(--font-weight-bold);
}

/* ===== Search ===== */
.search-box {
    width: 100%;
    max-width: 500px;
    position: relative;
    margin-bottom: 1.5rem;
}
.search-box input {
    width: 100%;
    padding: .75rem 1rem .75rem 2.5rem;
    background: var(--color-surface);
    border: 1px solid rgba(0,0,0,.1);
    border-radius: 8px;
    color: var(--color-text);
    font-size: var(--text-base);
    outline: none;
    transition: border-color .2s;
}
.search-box input:focus {
    border-color: var(--color-primary);
}
.search-box i {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-light);
}

/* ===== Filters ===== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.5rem;
}
.filter-btn {
    padding: .4rem .8rem;
    border: 1px solid rgba(0,0,0,.1);
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-light);
    font-size: .8rem;
    cursor: pointer;
    transition: all .2s;
}
.filter-btn:hover,
.filter-btn.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* Selects de filtre (Type, Categorie...) : meme look parchemin que les autres dropdowns */
.filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: .55rem 2.1rem .55rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,.2);
    background-color: var(--color-surface-elevated);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231a1a18' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: right .65rem center;
    background-size: 1rem;
    color: var(--color-text);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: .9rem;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.filter-select:hover { border-color: var(--color-primary); }
.filter-select:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(0,0,0,.05); }
.filter-select option { color: #1a1a18; background: #fdfaf0; }

/* ===== Detail page ===== */
.detail-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--color-surface);
    border-radius: 12px;
}
.detail-header img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    image-rendering: pixelated;
}
.detail-header img.detail-img {
    width: 320px;
    height: auto;
    max-height: 220px;
    object-fit: cover;
    image-rendering: auto;
    border-radius: 8px;
}
.detail-info h1 { margin-bottom: .5rem; }
.detail-types { display: flex; gap: .5rem; margin-bottom: .75rem; }

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-section {
    background: var(--color-surface);
    border-radius: 10px;
    padding: 1.25rem;
}
.info-section h2 {
    font-size: var(--text-lg);
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid rgba(0,0,0,.08);
}

/* ===== Stat Bars ===== */
.stat-table { width: 100%; border-collapse: collapse; }
.stat-table td { padding: .3rem .5rem; font-size: .9rem; white-space: nowrap; }
.stat-table .stat-label { color: var(--color-text-light); width: 80px; }
.stat-table .stat-value { width: 40px; text-align: right; font-weight: var(--font-weight-bold); color: var(--color-text); }
.stat-table .stat-bar-cell { width: 100%; }
.stat-bar { height: 10px; border-radius: 5px; background: rgba(0,0,0,.08); overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 5px; transition: width .5s ease; }
.stat-bar-fill.stat-low { background: #e3350d; }
.stat-bar-fill.stat-mid { background: #f0c040; }
.stat-bar-fill.stat-high { background: #4caf50; }
.stat-bar-fill.stat-max { background: #00c8ff; }
.stat-total { font-size: 1rem; font-weight: var(--font-weight-bold); color: var(--color-accent); padding-top: .5rem; border-top: 1px solid rgba(0,0,0,.08); }

/* ===== Pokemon Info Card ===== */
.pkmn-info-row { display: flex; justify-content: space-between; padding: .4rem 0; border-bottom: 1px solid rgba(0,0,0,.05); }
.pkmn-info-row:last-child { border-bottom: none; }
.pkmn-info-label { color: var(--color-text-light); font-size: .85rem; }
.pkmn-info-value { color: var(--color-text); font-weight: var(--font-weight-medium); font-size: .9rem; }

/* ===== Move Tabs ===== */
.move-tabs { display: flex; gap: 2px; margin-bottom: 1rem; flex-wrap: wrap; }
.move-tab {
    padding: .5rem .75rem;
    background: rgba(0,0,0,.05);
    border: none;
    color: var(--color-text-light);
    cursor: pointer;
    border-radius: 6px;
    font-size: .85rem;
    font-weight: var(--font-weight-medium);
    transition: all .2s;
}
.move-tab:hover { background: rgba(0,0,0,.06); color: var(--color-text); }
.move-tab.active { background: var(--color-primary); color: #fff; }
.move-panel { display: none; }
.move-panel.active { display: block; }

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: .25rem;
    margin-top: 2rem;
}
.pagination a, .pagination span {
    padding: .5rem .75rem;
    border-radius: 6px;
    font-size: .9rem;
}
.pagination a { background: var(--color-surface); color: var(--color-text-light); }
.pagination a:hover { background: var(--color-primary); color: #fff; }
.pagination .current { background: var(--color-primary); color: #fff; }

/* ===== Footer ===== */
.site-footer {
    background: var(--color-secondary);
    border-top: 1px solid rgba(255,255,255,.06);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--color-on-dark-muted);
    font-size: .85rem;
}
.site-footer a { color: var(--color-on-dark); }
.site-footer a:hover { color: #fff; }

/* ===== Hero (homepage) ===== */
.hero {
    text-align: center;
    padding: 4rem 0 3rem;
}
.hero h1 { margin-bottom: 1rem; }
.hero p {
    font-size: var(--text-lg);
    color: var(--color-text-light);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.quick-stats {
    display: flex;
    gap: .75rem;
    max-width: 900px;
    margin: 0 auto 3rem;
    justify-content: center;
}
.quick-stat {
    background: var(--color-surface);
    border-radius: 10px;
    padding: 1rem .75rem;
    text-align: center;
    flex: 1;
    min-width: 0;
}
@media (max-width: 600px) {
    .quick-stats { flex-wrap: wrap; }
    .quick-stat { flex: 0 0 calc(33.33% - .5rem); }
}
.quick-stat .stat-num {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-accent);
}
.quick-stat .stat-label {
    width: auto;
    text-align: center;
    margin-top: .25rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.section-header h2 { margin: 0; }
.section-header a { font-size: .9rem; }

/* ===== Homepage Dashboard ===== */
.home-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.dashboard-panel {
    background: var(--color-surface);
    border-radius: 10px;
    padding: 1.25rem;
    border: 1px solid rgba(0,0,0,.06);
}

.dashboard-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid rgba(0,0,0,.08);
}

.dashboard-panel-header h2 {
    font-size: var(--text-lg);
    margin: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.dashboard-panel-header h2 i {
    color: var(--color-primary);
}

.news-entry {
    padding: .75rem 0;
    border-bottom: 1px solid rgba(0,0,0,.04);
}
.news-entry:last-child { border-bottom: none; }

.news-date {
    font-size: .75rem;
    color: var(--color-text-light);
    display: flex;
    align-items: center;
    gap: .35rem;
}

.news-title {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    font-size: .9rem;
    margin-top: .15rem;
}

.news-body {
    font-size: .8rem;
    color: var(--color-text-light);
    margin-top: .25rem;
    line-height: 1.4;
}

.news-empty {
    color: var(--color-text-light);
    font-size: .85rem;
    padding: 1rem 0;
}

.home-timer-card {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 0;
    border-bottom: 1px solid rgba(0,0,0,.04);
}
.home-timer-card:last-child { border-bottom: none; }

.home-timer-icon {
    font-size: 1.2rem;
    color: var(--color-primary);
    width: 24px;
    text-align: center;
}

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

.home-timer-name {
    font-size: .85rem;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-timer-bar {
    height: 4px;
    background: rgba(0,0,0,.08);
    border-radius: 2px;
    overflow: hidden;
    margin-top: .3rem;
}

.home-timer-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--color-primary);
    transition: width 1s linear;
}

.home-timer-countdown {
    font-size: .8rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-accent);
    white-space: nowrap;
}

.home-timer-done {
    color: #4caf50;
}

.home-timer-card-done {
    background: rgba(76,175,80,.06);
    border-radius: 6px;
    padding: .6rem .5rem;
    margin: 0 -.5rem;
}

.home-timer-icon-done {
    color: #4caf50;
}

.timers-empty-msg {
    color: var(--color-text-light);
    font-size: .85rem;
    padding: 1rem 0;
}
.timers-empty-msg a { font-weight: var(--font-weight-medium); }

/* ===== Tables responsives (scroll horizontal sur mobile) ===== */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-inline: -.5rem;
    padding-inline: .5rem;
}

/* ===== Tablet ===== */
@media (max-width: 1024px) {
    .home-dashboard { grid-template-columns: 1fr 1fr; }
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 48px;
        min-height: 48px;
        padding: .5rem;
    }
    .site-header .container { padding-inline: 1rem; }

    .main-nav {
        /* Menu mobile : overlay ancré à top:100% du header (= juste sous lui),
           quelle que soit la hauteur variable du header (logo + recherche qui
           passe à la ligne). Le containing block est .site-header (sticky).
           z-index au-dessus du contenu, ombre pour le détacher. */
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: var(--color-secondary);
        border-top: 1px solid rgba(255,255,255,.12);
        box-shadow: 0 14px 28px rgba(0,0,0,.35);
        padding: .5rem 1rem .75rem;
        gap: .15rem;
        max-height: 80vh;
        overflow-y: auto;
        z-index: 200;
    }
    .main-nav.open { display: flex; }
    .main-nav a {
        padding: .85rem 1rem;
        font-size: 1rem;
        border-radius: 8px;
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    .lang-switcher {
        margin-left: 0;
        padding-left: 0;
        padding-top: .5rem;
        margin-top: .5rem;
        border-top: 1px solid rgba(255,255,255,.1);
        justify-content: center;
        gap: .5rem;
    }
    .lang-btn {
        padding: .65rem 1rem;
        font-size: .9rem;
        min-width: 48px;
        text-align: center;
    }
    h1 { font-size: var(--text-2xl); }
    h2 { font-size: var(--text-xl); }
    h3 { font-size: var(--text-lg); }

    main { padding: 1rem 0; }

    .hero { padding: 2rem 0 1.5rem; }
    .hero p { font-size: var(--text-base); }

    .detail-header {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem;
        gap: 1rem;
    }
    .detail-header img { width: 120px; height: 120px; }
    .detail-header img.detail-img { width: 100%; max-width: 100%; height: auto; max-height: 200px; }
    .detail-types { justify-content: center; flex-wrap: wrap; }

    .card-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
    .card { padding: .75rem; }
    .card img { width: 80px; height: 80px; }

    .info-grid { grid-template-columns: 1fr; gap: 1rem; }
    .info-section { padding: 1rem; }

    .calc-grid { grid-template-columns: 1fr; }
    .calc-field { flex-wrap: wrap; }
    .calc-field input,
    .calc-field select { width: 100%; min-height: 44px; }
    .calc-field label { min-width: 0; flex: 1 0 100%; }

    .home-dashboard { grid-template-columns: 1fr; gap: 1rem; }
    .dashboard-panel { padding: 1rem; }

    /* Tables : scroll horizontal automatique sur les containers communs */
    .info-section,
    .dashboard-panel,
    .calc-section,
    .calc-parent {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .data-table {
        font-size: .85rem;
    }
    .data-table th,
    .data-table td {
        padding: .5rem .6rem;
    }

    .quick-stats {
        gap: .5rem;
        margin-bottom: 2rem;
    }
    .quick-stat {
        padding: .75rem .5rem;
        flex: 0 0 calc(33.33% - .5rem);
        min-height: 48px;
    }
    .quick-stat .stat-num { font-size: var(--text-xl); }

    .filter-bar { gap: .35rem; }
    .filter-btn {
        padding: .55rem .8rem;
        font-size: .85rem;
        min-height: 44px;
    }

    .move-tab {
        padding: .65rem .9rem;
        min-height: 44px;
    }

    .pagination a, .pagination span {
        padding: .65rem .85rem;
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .breadcrumb { font-size: .85rem; }

    .section-header {
        flex-wrap: wrap;
        gap: .5rem;
    }

    /* Search input plein largeur */
    .search-box { max-width: 100%; }
    .search-box input { font-size: 1rem; min-height: 44px; }
}

/* ===== Small mobile ===== */
@media (max-width: 480px) {
    h1 { font-size: var(--text-xl); }
    h2 { font-size: var(--text-lg); }

    .hero { padding: 1.5rem 0 1rem; }

    .quick-stat { flex: 0 0 calc(50% - .25rem); }
    .quick-stat .stat-num { font-size: var(--text-lg); }
    .quick-stat .stat-label { font-size: .8rem; }

    .card-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
    .card { padding: .6rem; }
    .card img { width: 64px; height: 64px; }
    .card .card-name { font-size: .95rem; }

    .detail-header { padding: 1rem; }
    .detail-header img { width: 100px; height: 100px; }

    .info-section { padding: .85rem; }
    .info-section h2 { font-size: 1rem; }

    .data-table th,
    .data-table td { padding: .45rem .5rem; font-size: .8rem; }

    .site-logo { font-size: 1.05rem; }

    .breadcrumb ol { gap: .25rem; font-size: .8rem; }
}

/* ===== Breeding page ===== */
.breeding-tabs {
    display: flex;
    gap: .5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.calc-parent {
    background: var(--color-surface);
    border-radius: 10px;
    padding: 1.25rem;
}
.calc-parent h3 { margin-bottom: 1rem; }
.calc-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .5rem;
}
.calc-field label {
    font-size: .9rem;
    color: var(--color-text-light);
    min-width: 80px;
}
.calc-field input,
.calc-field select {
    background: var(--color-surface-elevated);
    border: 1px solid rgba(0,0,0,.18);
    border-radius: 8px;
    color: var(--color-text);
    padding: .5rem .75rem;
    font-size: .9rem;
    width: 100px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.calc-field input:focus,
.calc-field select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(31,29,25,.18);
}
.calc-field select {
    width: 160px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239898b0' viewBox='0 0 24 24'%3E%3Cpath d='M12 16l-6-6h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .6rem center;
    padding-right: 2rem;
    cursor: pointer;
}
.calc-field select option {
    background: var(--color-surface-elevated);
    color: var(--color-text);
}
.calc-iv { text-align: center; }

.egg-group-section .egg-group-content {
    display: none;
    padding-top: .75rem;
}
.egg-group-section.open .egg-group-content { display: block; }
.egg-group-arrow { transition: transform .2s; }
.egg-group-section.open .egg-group-arrow { transform: rotate(90deg); }

.egg-pokemon-card {
    padding: .5rem;
}
.egg-pokemon-card img {
    width: 48px;
    height: 48px;
}

/* Calculator - new planner */
.calc-section {
    background: var(--color-surface);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.calc-section h3 { margin-bottom: .75rem; }
.calc-iv-checks {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.calc-check {
    display: flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
    background: var(--color-bg);
    padding: .4rem .75rem;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,.1);
    transition: border-color .2s;
}
.calc-check:has(input:checked) {
    border-color: var(--color-primary);
}
.calc-check input { accent-color: var(--color-primary); }
.calc-check-label { font-size: .9rem; }
.calc-presets {
    display: flex;
    gap: .5rem;
    margin-top: .75rem;
    flex-wrap: wrap;
}
.calc-prices-grid {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Summary cards */
.calc-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}
.calc-summary-card {
    background: var(--color-surface);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
}
.calc-summary-icon {
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-bottom: .5rem;
}
.calc-summary-value {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
}
.calc-summary-label {
    font-size: .85rem;
    color: var(--color-text-light);
    margin-top: .25rem;
}

/* Breeding tree */
.tree-node { margin-left: 1.5rem; position: relative; }
.tree-node.depth-0 { margin-left: 0; }
.tree-node::before {
    content: '';
    position: absolute;
    left: -.75rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(0,0,0,.1);
}
.tree-node.depth-0::before { display: none; }
.tree-breed {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .5rem 0;
}
.tree-result {
    background: var(--color-surface);
    padding: .4rem .8rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: .9rem;
    border: 1px solid var(--color-primary);
}
.tree-items {
    font-size: .8rem;
    color: var(--color-text-light);
}
.tree-leaf {
    padding: .3rem 0;
    font-size: .85rem;
    color: var(--color-text-light);
}
.tree-children { padding-left: .5rem; }

/* Progress bar */
.calc-progress-bar {
    height: 8px;
    background: var(--color-surface);
    border-radius: 4px;
    overflow: hidden;
}
.calc-progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 4px;
    transition: width .3s ease;
}

/* Interactive tree nodes */
.tree-clickable {
    cursor: pointer;
    user-select: none;
    transition: opacity .2s;
}
.tree-clickable:hover {
    opacity: .8;
}
.tree-check {
    margin-right: .4rem;
    font-size: 1.1rem;
    vertical-align: middle;
}
.tree-check i { color: rgba(0,0,0,.3); }
.tree-clickable.done .tree-check i { color: #4ade80; }
.tree-clickable.done {
    opacity: .5;
}
.tree-clickable.done .tree-result {
    text-decoration: line-through;
    border-color: #4ade80;
}

/* Advanced options accordion */
.calc-advanced-toggle {
    transition: border-color .2s;
}
.calc-advanced-toggle:hover {
    border-color: rgba(0,0,0,.15);
}
.calc-adv-arrow {
    transition: transform .2s;
    font-size: 1.2rem;
}
.calc-advanced-toggle.open .calc-adv-arrow {
    transform: rotate(90deg);
}
.calc-advanced-content {
    display: none;
    margin-top: -.5rem;
}
.calc-advanced-content.open {
    display: block;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    margin-bottom: 1rem;
    font-size: var(--text-sm, .9rem);
    color: var(--color-text-light, #aaa);
}
.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    padding: 0;
    margin: 0;
}
.breadcrumb li {
    display: flex;
    align-items: center;
}
.breadcrumb li:not(:last-child)::after {
    content: '/';
    margin-left: .35rem;
    color: var(--color-text-light, #777);
    opacity: .6;
}
.breadcrumb a {
    color: var(--color-accent);
}
.breadcrumb [aria-current="page"] {
    color: var(--color-text, #fff);
    opacity: .85;
}

/* ===== Recherche globale du header (N&B parchemin) ===== */
.header-search {
    position: relative;
    flex: 1 1 240px;
    max-width: 440px;
    margin: 0 1rem;
}
.header-search { position: relative; flex: 1 1 240px; max-width: 440px; margin: 0 1rem; }
.header-search > i {
    position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
    color: var(--color-on-dark); font-size: 1.1rem; pointer-events: none; z-index: 2;
}
.header-search input {
    width: 100%; height: 42px; padding: 0 .9rem 0 2.2rem;
    border-radius: 8px; border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.08); color: var(--color-on-dark); font-size: .9rem;
    outline: none; transition: border-color .2s, background .2s;
}
.header-search input::placeholder { color: var(--color-on-dark-muted); }
.header-search input:focus { border-color: var(--color-on-dark); background: rgba(255,255,255,.14); }

.header-search-results {
    display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 200;
    background: var(--color-surface-elevated); border: 1px solid rgba(0,0,0,.18); border-radius: 10px; padding: .35rem;
    box-shadow: 0 14px 34px rgba(20,18,15,.28); max-height: 72vh; overflow-y: auto;
}
.header-search-results.open { display: block; }
.hsr-group-title {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--color-text-light); font-weight: 700; padding: .45rem .6rem .2rem;
}
.hsr-item {
    display: flex; align-items: center; gap: .6rem; padding: .42rem .6rem;
    border-radius: 7px; color: var(--color-text); text-decoration: none;
}
.hsr-item:hover, .hsr-item.active { background: rgba(0,0,0,.06); color: var(--color-text); }
.hsr-item img {
    width: 34px; height: 34px; object-fit: contain; border-radius: 5px;
    background: var(--color-surface); border: 1px solid rgba(0,0,0,.12); flex-shrink: 0;
    image-rendering: pixelated;
}
.hsr-item .hsr-name { font-weight: 600; font-size: .9rem; }
.hsr-item .hsr-sub { margin-left: auto; font-size: .74rem; color: var(--color-text-light); white-space: nowrap; }
.hsr-empty { padding: .6rem .7rem; color: var(--color-text-light); font-size: .85rem; }

/* ===== Menus deroulants du header (Guides, Langue) ===== */
.nav-dd, .lang-dd { position: relative; }
.nav-dd-toggle, .lang-dd-toggle {
    background: transparent; border: none; cursor: pointer; font-family: var(--font-primary);
    color: var(--color-on-dark-muted); padding: .5rem .75rem; border-radius: 6px;
    font-size: .9rem; font-weight: var(--font-weight-medium);
    display: inline-flex; align-items: center; gap: .4rem; transition: all .2s;
}
.nav-dd-toggle:hover, .lang-dd-toggle:hover,
.nav-dd-toggle.active, .nav-dd.open .nav-dd-toggle, .lang-dd.open .lang-dd-toggle {
    color: #fff; background: rgba(255,255,255,.08);
}
.nav-dd-caret { font-size: 1rem; transition: transform .2s; }
.nav-dd.open .nav-dd-caret, .lang-dd.open .lang-dd-caret { transform: rotate(180deg); }
.nav-dd-menu {
    display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 200px; z-index: 200;
    background: var(--color-secondary); border: 1px solid rgba(255,255,255,.12); border-radius: 10px;
    padding: .35rem; box-shadow: 0 14px 30px rgba(0,0,0,.4);
}
.lang-dd-menu { left: auto; right: 0; min-width: 165px; }
.nav-dd.open .nav-dd-menu, .lang-dd.open .lang-dd-menu { display: block; }
.nav-dd-menu a {
    display: flex; align-items: center; gap: .55rem; padding: .55rem .7rem; border-radius: 7px;
    color: var(--color-on-dark-muted); font-size: .9rem; text-decoration: none;#fff; }
.nav-dd-menu a i { font-size: 1.05rem; }
.flag {
    width: 21px; height: 14px; border-radius: 2px; display: inline-block;
    vertical-align: -3px; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(0,0,0,.18);
}

/* Logo header (wordmark) */
.site-header .site-logo img { height: 46px; width: auto; }

@media (max-width: 900px) {
    .header-search { max-width: 280px; }
}
@media (max-width: 768px) {
    .header-search { order: 3; flex-basis: 100%; margin: .15rem 0 .55rem; max-width: none; }
    .site-header .container { flex-wrap: wrap; height: auto; padding-top: .6rem; padding-bottom: .35rem; }
    .nav-dd, .lang-dd { width: 100%; }
    .nav-dd-toggle, .lang-dd-toggle { width: 100%; justify-content: flex-start; }
    .nav-dd-menu { position: static; box-shadow: none; margin: .15rem 0 .15rem 1rem; min-width: 0; }
    .lang-dd-menu { right: auto; left: 0; }
}

/* ===== Durcissement responsive (audit 2026) =====
   Règles transverses appliquées à toutes les pages /Pokemmo/ pour éviter les
   débordements horizontaux et garantir des cibles tactiles >=44px. */

/* Filet de sécurité : une table de données placée directement dans le flux
   (sans wrapper overflow) scrolle au lieu de casser la largeur de page. */
@media (max-width: 768px) {
    main .container > .data-table,
    main .container > table.data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* Les tables de stats peuvent renvoyer à la ligne plutôt que déborder. */
    .stat-table td { white-space: normal; }
    /* En-tête de fiche : réduit l'écart quand il reste en ligne (480-768). */
    .detail-header { gap: 1rem; }
}

/* Très petits écrans : tout conteneur de cartes reste en 2 colonnes nettes
   et les encarts à largeur max ne débordent jamais le viewport. */
@media (max-width: 380px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
}

/* Encarts texte à largeur max centrée (about, guides, alerts) : ne jamais
   dépasser la largeur dispo, quel que soit le style inline appliqué. */
@media (max-width: 600px) {
    div[style*="max-width"] { max-width: 100% !important; }
}

/* ===== Carrousel horizontal (Pokemon en vedette) ===== */
.dex-carousel { position: relative; }
.dex-track {
    display: grid; grid-auto-flow: column;
    grid-auto-columns: calc((100% - 3rem) / 4);
    grid-template-columns: none;
    gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory;
    scroll-behavior: smooth; padding: .25rem 2px .5rem;
    scrollbar-width: none; -ms-overflow-style: none;
}
.dex-track::-webkit-scrollbar { display: none; }
.dex-track > .card { scroll-snap-align: start; }
.dex-nav {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
    background: var(--color-secondary); color: var(--color-on-dark);
    border: 1px solid rgba(0,0,0,.2); display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; box-shadow: 0 4px 12px rgba(20,18,15,.25); transition: opacity .2s, transform .15s;
}
.dex-nav:hover { transform: translateY(-50%) scale(1.06); }
.dex-prev { left: -8px; }
.dex-next { right: -8px; }
.dex-nav:disabled { opacity: 0; pointer-events: none; }
@media (max-width: 768px) { .dex-nav { display: none; } }
/* dex-track 2-cols : 2 cartes visibles sur mobile */
@media (max-width: 760px) { .dex-track { grid-auto-columns: calc((100% - 1rem) / 2); } }

/* =====================================================================
   CHAMPIONS-SPECIFIC COMPONENTS (re-themed to parchment)
   ===================================================================== */

/* =====================================================================
   HOME PAGE (index.php)
   Sections : hero modern, stats, featured, megas, news, explore, discord
   ===================================================================== */

/* ----- Hero modern ----- */
.home-hero {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 4rem 2.5rem;
    margin-top: 1rem;
    margin-bottom: 3rem;
    background: var(--color-surface);
    border: 1px solid rgba(0,0,0,.12);
}
.home-hero-inner {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}
.home-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .35rem .85rem;
    border-radius: 999px;
    background: rgba(108,92,231,.18);
    border: 1px solid rgba(108,92,231,.35);
    color: #cfc4ff;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}
.home-hero-badge i { font-size: .85rem; color: var(--color-accent); }
.home-hero h1 {
    /* Inter en gras : lisible. Press Start 2P uniquement sur le logo header. */
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    background: linear-gradient(180deg, var(--color-text) 0%, #c8c4e8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -.02em;
}
.home-hero p {
    color: var(--color-text-light);
    font-size: 1.35rem;
    line-height: 1.4;
    margin-bottom: 1.75rem;
}
.home-hero-actions {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .75rem;
}

/* ----- Section headers (reutilisable) ----- */
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.section-head h2 {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: .65rem;
}
.section-head h2 i { color: var(--color-primary); }
.section-head p {
    color: var(--color-text-light);
    margin: .35rem 0 0;
    font-size: .95rem;
}
.section-head .section-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .9rem;
    font-weight: 600;
    color: var(--color-accent);
}
.section-head .section-link:hover { color: var(--color-text); }
.home-section { margin-bottom: 3.5rem; }

/* ----- Stats grid ----- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
}
.stat-card {
    background: var(--color-surface);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 14px;
    padding: 1.25rem 1.25rem 1.1rem;
    position: relative;
    overflow: hidden;
    transition: transform .2s, border-color .2s;
    /* Rendu propre quand stat-card est un <a> (link to filtered pokedex) */
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
.stat-card:hover .stat-value { color: var(--color-accent); }
.stat-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(108,92,231,.35), transparent 50%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
}
.stat-card:hover { transform: translateY(-3px); border-color: rgba(108,92,231,.5); }
.stat-card:hover::before { opacity: 1; }
.stat-card .stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(108,92,231,.15);
    color: #b8a9ff;
    font-size: 1.1rem;
    margin-bottom: .85rem;
}
.stat-card.stat-accent .stat-icon { background: rgba(0,206,201,.15); color: var(--color-accent); }
.stat-card.stat-mega .stat-icon { background: rgba(239,63,122,.15); color: #ff80a8; }
.stat-card.stat-gold .stat-icon { background: rgba(250,193,0,.15); color: #facc15; }
.stat-card .stat-value {
    /* Inter Black : gros nombre lisible et propre. */
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1;
    margin-bottom: .35rem;
    letter-spacing: -.03em;
}
.stat-card .stat-label {
    color: var(--color-text-light);
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* ----- Featured grid (Pokemon en vedette) ----- */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}
.featured-card {
    background: var(--color-surface);
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 14px;
    padding: 1.1rem 1rem 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform .2s, border-color .2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.featured-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
}
.featured-card .featured-num {
    position: absolute;
    top: .55rem;
    right: .7rem;
    font-size: .7rem;
    font-weight: 700;
    color: var(--color-text-light);
    opacity: .55;
    z-index: 1;
}
.featured-card .featured-tag {
    position: absolute;
    top: .55rem;
    left: .7rem;
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: .15rem .4rem;
    border-radius: 4px;
    background: rgba(108,92,231,.18);
    color: #cfc4ff;
    z-index: 1;
}
.featured-card .featured-tag.tag-mega {
    background: rgba(239,63,122,.18);
    color: #ff9bbe;
}
.featured-card img {
    width: 110px;
    height: 110px;
    object-fit: contain;
    margin-bottom: .5rem;
    z-index: 1;
    filter: drop-shadow(0 6px 12px rgba(20,18,15,.2));
    transition: transform .25s;
}
.featured-card:hover img { transform: scale(1.05); }
.featured-card .featured-name {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-text);
    font-size: 1.15rem;
    line-height: 1.25;
    word-break: break-word;
    z-index: 1;
}
.featured-card .featured-types {
    display: flex;
    gap: .25rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: .4rem;
    z-index: 1;
}

/* ----- Teams grid (dernieres equipes communautaires) ----- */
.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: .75rem;
}
.team-card {
    background: var(--color-surface);
    border: 1px solid rgba(0, 0, 0, .10);
    border-radius: 12px;
    padding: .85rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: .55rem;
    transition: transform .2s, border-color .2s, background .2s;
    /* Defensif : evite tout debordement / shrink etrange sur petit ecran */
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.team-card:hover {
    transform: translateY(-3px);
    border-color: var(--color-primary);
    color: inherit;
}
.team-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
}
.team-card-format {
    font-family: var(--font-heading);
    font-size: .55rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .2rem .45rem;
    border-radius: 4px;
    background: rgba(108, 92, 231, .18);
    color: #cfc4ff;
}
.team-card-name {
    font-size: .85rem;
    margin: 0;
    line-height: 1.3;
    color: var(--color-text);
}
.team-card-members {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .25rem;
    padding: .4rem;
    background: rgba(0, 0, 0, .06);
    border-radius: 8px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.team-card-member {
    position: relative;
    min-width: 0;
    /* Padding-bottom 100% = ratio carre garanti sur TOUS les navigateurs.
       aspect-ratio n'est pas fiable sur iOS Safari < 15.4 dans une grille. */
    width: 100%;
    padding-top: 100%;
    background: var(--color-surface-elevated);
    border-radius: 6px;
    overflow: hidden;
}
.team-card-member img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    margin: 0;
}
.team-card-member-fallback {
    color: var(--color-text-light);
    font-size: 1.1rem;
}
.team-card-mega-badge {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: rgba(239, 63, 122, .9);
    color: #fff;
    font-family: var(--font-heading);
    font-size: .45rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.team-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.team-card-author {
    color: var(--color-text-light);
    font-size: .85rem;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.team-card-cta {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    color: var(--color-accent);
    font-size: .85rem;
    transition: gap .2s;
    flex-shrink: 0;
}
.team-card:hover .team-card-cta { gap: .45rem; }

/* Responsive teams : sans ces overrides le minmax(260px) force des cartes
   > viewport sur petits ecrans et provoque un debordement / scroll horizontal. */
@media (max-width: 600px) {
    .teams-grid { grid-template-columns: 1fr; gap: .65rem; }
    .team-card { padding: .75rem; gap: .5rem; }
    .team-card-name { font-size: 1rem; }
    .team-card-members { padding: .35rem; gap: .3rem; }
    .team-card-format { font-size: .6rem; }
    .team-card-footer { font-size: .8rem; }
    .team-card-author { font-size: .8rem; }
}
@media (max-width: 380px) {
    .team-card { padding: .65rem; }
    .team-card-head { flex-wrap: wrap; gap: .35rem; }
    .team-card-name { font-size: .95rem; }
    .team-card-author span { display: none; } /* l'icone user-line garde le contexte */
}

/* ----- News list ----- */
.news-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.news-card {
    background: var(--color-surface);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 14px;
    padding: 1.5rem 1.4rem;
    display: flex;
    flex-direction: column;
    transition: transform .2s, border-color .2s;
}
.news-card:hover { transform: translateY(-3px); border-color: rgba(108,92,231,.4); }
.news-card .news-meta {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
    color: var(--color-text-light);
    font-size: .78rem;
}
.news-card .news-meta .news-date {
    font-weight: 600;
    color: var(--color-accent);
}
.news-card .news-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(108,92,231,.15);
    color: #b8a9ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    margin-bottom: .85rem;
}
.news-card h3 {
    font-size: 1.05rem;
    margin-bottom: .5rem;
    line-height: 1.3;
}
.news-card p {
    color: var(--color-text-light);
    font-size: .92rem;
    line-height: 1.55;
    margin: 0;
    flex: 1;
}

/* ----- Explore grid ----- */
.explore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}
.explore-card {
    background: var(--color-surface);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 14px;
    padding: 1.5rem;
    transition: transform .2s, border-color .2s, background .2s;
    display: flex;
    flex-direction: column;
    position: relative;
}
.explore-card:hover {
    transform: translateY(-3px);
    border-color: var(--color-primary);
}
.explore-card .explore-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(108,92,231,.15);
    color: #b8a9ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: .85rem;
}
.explore-card.explore-accent .explore-icon { background: rgba(0,206,201,.15); color: var(--color-accent); }
.explore-card.explore-pink .explore-icon { background: rgba(239,63,122,.15); color: #ff80a8; }
.explore-card.explore-gold .explore-icon { background: rgba(250,193,0,.15); color: #facc15; }
.explore-card h3 {
    font-size: 1.1rem;
    margin-bottom: .35rem;
    color: var(--color-text);
}
.explore-card p {
    color: var(--color-text-light);
    font-size: .9rem;
    line-height: 1.5;
    margin: 0 0 1rem;
    flex: 1;
}
.explore-card .explore-cta {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--color-accent);
}
.explore-card .explore-cta i { transition: transform .2s; }
.explore-card:hover .explore-cta i { transform: translateX(3px); }
.explore-card .explore-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: .2rem .5rem;
    border-radius: 4px;
    background: rgba(250,193,0,.15);
    color: #facc15;
}

/* ----- Discord CTA card ----- */
.discord-card {
    margin-top: 1rem;
    background: var(--color-surface);
    border: 1px solid rgba(88,101,242,.35);
    border-radius: 18px;
    padding: 2.25rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.discord-card .discord-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(88,101,242,.2);
    color: #c7d2ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}
.discord-card .discord-text { flex: 1 1 280px; min-width: 0; }
.discord-card h3 { margin-bottom: .35rem; color: var(--color-text); }
.discord-card p { color: var(--color-text-light); margin: 0; font-size: .95rem; }
.discord-card .btn { background: #5865f2; }
.discord-card .btn:hover { background: #4752c4; }

/* ----- Responsive home ----- */
@media (max-width: 768px) {
    .home-hero { padding: 2.5rem 1.25rem; border-radius: 18px; }
    .home-hero h1 { font-size: 1.85rem; }
    .home-hero p { font-size: .98rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: .65rem; }
    .stat-card { padding: 1rem; }
    .stat-card .stat-value { font-size: 1.6rem; }
    .featured-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .65rem; }
    .featured-card img { width: 88px; height: 88px; }
    .featured-card .featured-name { font-size: 1.05rem; }
    .news-list { gap: .75rem; }
    .news-card { padding: 1.15rem 1rem; }
    .explore-grid { gap: .75rem; }
    .explore-card { padding: 1.15rem 1rem; }
    .discord-card { padding: 1.5rem 1.25rem; gap: 1rem; }
    .discord-card .discord-icon { width: 52px; height: 52px; font-size: 1.6rem; }
    .home-section { margin-bottom: 2.5rem; }
}
@media (max-width: 420px) {
    .home-hero-actions .btn { flex: 1 1 100%; justify-content: center; }
    .section-head { flex-direction: column; align-items: flex-start; gap: .5rem; }
}

/* =====================================================================
   NEWS SYSTEM
   - .news-card  : compact card used in homepage grid (existing styles
                   above + the additions below).
   - .news-row   : horizontal card used in the listing page (/news/).
   - .news-article : full article view (/news/{slug}).
   ===================================================================== */

/* Make .news-card a proper anchor (was <article>) */
a.news-card {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
a.news-card:hover { color: inherit; }

/* Type badge (homepage + listing) - pixel font reads tiny so we use the
   primary VT323 here, sized close to the surrounding meta line */
.news-meta .news-type {
    font-family: var(--font-primary);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 400;
    font-size: 1rem;
    padding: .1rem .6rem;
    border-radius: 999px;
    background: rgba(108, 92, 231, .18);
    color: #b8a9ff;
    line-height: 1.3;
}

/* "Read more" arrow on homepage cards */
.news-card .news-card-link {
    margin-top: auto;
    padding-top: .75rem;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: var(--color-accent);
    font-size: 1.1rem;
    font-weight: 400;
    opacity: .9;
    transition: opacity .2s, gap .2s;
}
.news-card:hover .news-card-link {
    opacity: 1;
    gap: .5rem;
}

/* ----- Listing page (/news/) ----- */
.news-rows {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 820px;
    margin: 0 auto;
}
.news-row {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    background: var(--color-surface);
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 14px;
    padding: 1.5rem;
    color: inherit;
    text-decoration: none;
    transition: transform .2s, border-color .2s, background .2s;
}
.news-row:hover {
    transform: translateY(-2px);
    border-color: rgba(108, 92, 231, .4);
    color: inherit;
}
.news-row-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: rgba(108, 92, 231, .15);
    color: #b8a9ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.news-row-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.news-row .news-meta {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
    color: var(--color-text-light);
    font-size: 1rem;
}
.news-row .news-date { font-weight: 400; }
.news-row-title {
    font-size: var(--text-xl);
    margin: 0;
    line-height: 1.3;
    color: var(--color-text);
}
.news-row-excerpt {
    color: var(--color-text-light);
    font-size: 1.15rem;
    line-height: 1.55;
    margin: 0;
}
.news-row .news-card-link {
    margin-top: .25rem;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: var(--color-accent);
    font-size: 1.1rem;
    font-weight: 400;
    transition: gap .2s;
}
.news-row:hover .news-card-link { gap: .5rem; }

/* ----- Article page (/news/{slug}) ----- */
.news-article {
    max-width: 760px;
    margin: 0 auto;
    background: var(--color-surface);
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 16px;
    padding: 2.5rem;
}
.news-article-head { margin-bottom: 1.5rem; }
.news-article-head .news-meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    color: var(--color-text-light);
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
}
.news-article-head .news-date { font-weight: 400; }
.news-author { opacity: .85; }
.news-article-head h1 {
    font-size: var(--text-3xl);
    margin-bottom: 1rem;
    line-height: 1.2;
}
.news-article-lead {
    color: var(--color-text-light);
    font-size: var(--text-lg);
    line-height: 1.5;
    margin: 0;
}
.news-article-cover {
    margin: 1.5rem -2.5rem;
}
.news-article-cover img {
    width: 100%;
    height: auto;
    display: block;
}
.news-article-body {
    color: var(--color-text);
    font-size: var(--text-base);
    line-height: var(--line-height-relaxed);
    margin-top: 1.5rem;
}
.news-article-body p {
    margin-bottom: 1rem;
}
.news-article-body p:last-child { margin-bottom: 0; }
.news-article-body a {
    color: var(--color-accent);
    text-decoration: underline;
    text-decoration-color: rgba(0, 206, 201, .35);
    text-underline-offset: 3px;
}
.news-article-body a:hover {
    text-decoration-color: var(--color-accent);
    color: var(--color-text);
}
.news-article-body strong { color: var(--color-text); }
.news-article-body code {
    background: rgba(0, 0, 0, .05);
    padding: .1rem .35rem;
    border-radius: 4px;
    font-size: .92em;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.news-article-body ul,
.news-article-body ol {
    margin: 0 0 1rem 1.5rem;
}
.news-article-body li { margin-bottom: .35rem; }
.news-article-cta {
    margin-top: 2rem;
    text-align: center;
}

/* Bottom prev / index / next nav on article pages */
.news-article-nav {
    max-width: 760px;
    margin: 1.5rem auto 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: .75rem;
    align-items: stretch;
}
.news-article-nav-link {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .9rem 1.1rem;
    background: var(--color-surface);
    border: 1px solid rgba(0, 0, 0, .10);
    border-radius: 10px;
    color: var(--color-text-light);
    font-size: 1.1rem;
    transition: color .2s, border-color .2s, transform .2s;
    min-width: 0;
}
.news-article-nav-link:hover {
    color: var(--color-text);
    border-color: rgba(108, 92, 231, .45);
    transform: translateY(-1px);
}
.news-article-nav-link.next { justify-content: flex-end; text-align: right; }
.news-article-nav-link.center { white-space: nowrap; }
.news-article-nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ----- Responsive news ----- */
@media (max-width: 768px) {
    .news-article { padding: 1.5rem 1.25rem; border-radius: 12px; }
    .news-article-cover { margin: 1rem -1.25rem; }
    .news-article-body { font-size: .98rem; }
    .news-row { padding: 1.15rem 1rem; gap: 1rem; }
    .news-row-icon { width: 44px; height: 44px; font-size: 1.25rem; }
    .news-row-title { font-size: 1.1rem; }
    .news-article-nav { grid-template-columns: 1fr; }
    .news-article-nav-link.next { justify-content: flex-start; text-align: left; }
}

/* =====================================================================
   TEAMS (competitive teams of 6 Pokemon)
   - .teams-table  : ranked listing with 6 sprite columns.
   - .team-row     : clickable row (JS-enhanced).
   - .format-badge : pill with format icon + label (Singles/Doubles/Generalist).
   - .team-header  : detail page hero with vote button.
   - .team-member-card : per-Pokemon detail block (anchor-targetable).
   ===================================================================== */

/* ---------- Format + regulation badges (shared listing + detail) ---------- */
.format-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-family: var(--font-primary);
    font-size: 1rem;
    padding: .15rem .65rem;
    border-radius: 999px;
    background: rgba(108, 92, 231, .18);
    color: #b8a9ff;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 400;
    line-height: 1.4;
}
.format-badge i { font-size: 1rem; }
.format-singles    { background: rgba(0, 206, 201, .18);  color: #6df0ec; }
.format-doubles    { background: rgba(108, 92, 231, .18); color: #b8a9ff; }
.format-generalist { background: rgba(255, 203, 5, .18);  color: #ffd84d; }

.team-reg {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-primary);
    font-size: .95rem;
    padding: .15rem .65rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, .05);
    color: var(--color-text-light);
    border: 1px solid rgba(0, 0, 0, .10);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Top-of-detail tags row (kept as .build-tags name for backwards CSS reuse) */
.build-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .65rem;
}

.detail-sub a {
    color: var(--color-accent);
    text-decoration: underline;
    text-decoration-color: rgba(0, 206, 201, .35);
    text-underline-offset: 3px;
}
.detail-sub a:hover { color: var(--color-text); }

.nature-effect {
    display: block;
    color: var(--color-text-light);
    font-size: .85rem;
    margin-top: .2rem;
    font-family: var(--font-primary);
}

/* ---------- Listing table ---------- */
.teams-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--color-surface);
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 14px;
}
.teams-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}
.teams-table thead th {
    text-align: left;
    padding: .9rem 1rem;
    font-family: var(--font-primary);
    font-size: .95rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--color-text-light);
    background: rgba(0, 0, 0, .04);
    border-bottom: 1px solid rgba(0, 0, 0, .08);
}
.teams-table thead th.col-rank { text-align: center; width: 4rem; }
.teams-table thead th.col-pokemon { text-align: left; }

.teams-table tbody td {
    padding: .85rem .9rem;
    border-bottom: 1px solid rgba(0, 0, 0, .07);
    vertical-align: middle;
    font-size: 1rem;
}
.teams-table tbody tr:last-child td { border-bottom: none; }

.team-row { cursor: pointer; transition: background .15s; outline: none; }
.team-row:hover  { background: rgba(0, 0, 0, .03); }
.team-row:focus  { background: rgba(108, 92, 231, .08); box-shadow: inset 0 0 0 2px rgba(108, 92, 231, .35); }

.team-row .col-rank {
    text-align: center;
    font-family: var(--font-heading);
    color: var(--color-text);
    font-size: var(--text-lg);
}
.team-row .team-link {
    color: var(--color-text);
    font-weight: 400;
    font-size: 1.05rem;
    text-decoration: none;
    border-bottom: 1px dashed transparent;
}
.team-row .team-link:hover { border-bottom-color: var(--color-accent); }
.team-row .team-reg { margin-left: .5rem; vertical-align: middle; }

.col-pokemon { width: 60px; padding-left: 0 !important; padding-right: 0 !important; text-align: center; }
.roster-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: rgba(0, 0, 0, .03);
    border: 1px solid rgba(0, 0, 0, .07);
    transition: background .15s, border-color .15s, transform .15s;
}
.roster-link:hover {
    background: rgba(108, 92, 231, .12);
    border-color: rgba(108, 92, 231, .35);
    transform: translateY(-2px);
}
.roster-link img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}
.roster-empty {
    display: inline-block;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    border: 1px dashed rgba(0, 0, 0, .08);
}

.teams-hint {
    color: var(--color-text-light);
    font-size: .95rem;
    margin: 1rem 0 0;
    text-align: center;
}
.teams-hint i { color: var(--color-accent); margin-right: .25rem; }

/* ---------- Detail : header + roster strip + vote ---------- */
.team-header {
    background: var(--color-surface);
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 14px;
    padding: 1.75rem 1.75rem 1.25rem;
    margin-bottom: 1.5rem;
}
.team-header-top {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
}
.team-header-text { flex: 1 1 320px; min-width: 0; }
.team-header h1 {
    margin: 0 0 .25rem;
    font-size: clamp(1.5rem, 3.5vw, var(--text-3xl));
    line-height: 1.2;
}
.team-author { color: var(--color-text-light); margin: .35rem 0 0; font-size: 1rem; }
.team-author strong { color: var(--color-text); }


/* Roster strip at top of detail page */
.team-roster-large {
    list-style: none;
    padding: 1rem 0 0;
    margin: 1.25rem 0 0;
    border-top: 1px solid rgba(0, 0, 0, .07);
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .65rem;
}
.team-roster-large li {}
.team-roster-large a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    padding: .65rem .35rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, .03);
    border: 1px solid rgba(0, 0, 0, .07);
    transition: background .15s, border-color .15s, transform .15s;
    color: var(--color-text-light);
    text-align: center;
}
.team-roster-large a:hover {
    background: rgba(108, 92, 231, .1);
    border-color: rgba(108, 92, 231, .35);
    color: var(--color-text);
    transform: translateY(-2px);
}
.team-roster-large img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    image-rendering: pixelated;
}
.team-roster-large span {
    font-size: .9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.members-heading {
    margin: 2.5rem 0 1rem;
    font-size: var(--text-2xl);
    display: flex;
    align-items: center;
    gap: .5rem;
}
.members-heading i { color: var(--color-accent); }

/* ---------- Member card ---------- */
.team-member-card {
    background: var(--color-surface);
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    scroll-margin-top: 80px; /* clears sticky header for #slot-N anchors */
}
.member-header {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    flex-wrap: wrap;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, .07);
}
.member-header img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    image-rendering: pixelated;
    flex-shrink: 0;
}
.member-title { flex: 1; min-width: 0; }
.member-slot {
    display: inline-block;
    font-family: var(--font-primary);
    font-size: .9rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .25rem;
}
.member-title h3 {
    margin: 0 0 .5rem;
    font-size: var(--text-xl);
    line-height: 1.2;
}
.member-title h3 a { color: var(--color-text); }
.member-title h3 a:hover { color: var(--color-accent); }
.member-types { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: .5rem; }
.member-role {
    margin: 0;
    color: var(--color-text-light);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}
.member-role i { color: var(--color-accent); }

.member-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, .07);
}
.member-setup .pkmn-info-row { gap: 1rem; }
.member-sp h4,
.member-moves h4 {
    margin: 0 0 .75rem;
    font-size: var(--text-lg);
    display: flex;
    align-items: center;
    gap: .4rem;
}
.member-sp h4 i,
.member-moves h4 i { color: var(--color-accent); }
.member-moves { padding-top: 1.25rem; }

/* Stat-table tuning inside member-sp :
   - labels nowrap + slightly wider so "Atq Sp" / "Def Sp" never wrap
   - explicit gap before the bar (right padding on value cell)
   - bar capped so it does not stretch edge-to-edge */
.member-sp .stat-table .stat-label {
    width: auto;
    min-width: 64px;
    padding-right: .25rem;
    white-space: nowrap;
}
.member-sp .stat-table .stat-value {
    width: 36px;
    padding-right: 1rem;
    text-align: right;
    white-space: nowrap;
}
.member-sp .stat-table .stat-bar-cell {
    width: 100%;
    max-width: 200px;
}
.member-sp .stat-bar { height: 8px; border-radius: 4px; }
.member-sp .stat-bar-fill { border-radius: 4px; }

/* Notes card : flat surface, no left border accent */
.member-notes {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    background: rgba(108, 92, 231, .08);
    border-radius: 8px;
    display: flex;
    gap: .75rem;
    align-items: flex-start;
}
.member-notes i {
    color: var(--color-primary);
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: .1rem;
}
.member-notes p {
    margin: 0;
    color: var(--color-text);
    font-size: 1rem;
    line-height: 1.5;
}

/* Share code (compact pill : label + monospace code + copy button) */
.share-code {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-top: .75rem;
    padding: .5rem .75rem;
    background: rgba(0, 0, 0, .04);
    border: 1px solid rgba(0, 0, 0, .10);
    border-radius: 10px;
}
.share-code-label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-family: var(--font-primary);
    font-size: .9rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.share-code-label i { color: var(--color-accent); }
.share-code-value {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
    background: rgba(0, 0, 0, .06);
    padding: .25rem .65rem;
    border-radius: 6px;
    letter-spacing: .1em;
    user-select: all;
}
.share-code-copy {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem .75rem;
    background: transparent;
    color: var(--color-accent);
    border: 1px solid rgba(0, 206, 201, .35);
    border-radius: 6px;
    font-family: var(--font-primary);
    font-size: .9rem;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.share-code-copy:hover { background: rgba(0, 206, 201, .12); color: var(--color-text); }
.share-code-copy.copied {
    background: rgba(76, 175, 80, .15);
    color: #6bdc6e;
    border-color: rgba(76, 175, 80, .4);
}
.share-code-copy.copied i::before { content: "\ec4d"; /* ri-check-line */ }
.share-code-hint {
    margin: .35rem 0 0;
    font-size: .85rem;
    color: var(--color-text-light);
    opacity: .8;
}
@media (max-width: 480px) {
    .share-code { width: 100%; justify-content: space-between; }
    .share-code-value { flex: 1; text-align: center; }
}

/* ---------- Responsive teams ---------- */
@media (max-width: 768px) {
    .team-header { padding: 1.25rem; }
    .team-header-top { gap: 1rem; }
    .team-roster-large { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .team-roster-large img { width: 56px; height: 56px; }
    .member-body { grid-template-columns: 1fr; gap: 1rem; }
    .member-header { gap: .9rem; }
    .member-header img { width: 80px; height: 80px; }
}
@media (max-width: 480px) {
    .roster-link, .roster-empty { width: 44px; height: 44px; }
    .roster-link img { width: 40px; height: 40px; }
    .col-pokemon { width: 48px; }
    .teams-table thead th { font-size: .85rem; padding: .65rem .55rem; }
    .teams-table tbody td { padding: .65rem .55rem; }
    .team-roster-large { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* --- Ajustement Aniimo (pre-lancement) : la nav ne compte que 2 entrees, le
   space-between du conteneur decalerait la recherche vers le centre. On ancre
   la recherche a cote du logo et on pousse la nav a droite, pour retrouver
   l'agencement visuel des autres wikis. --- */
.site-header .container { justify-content: flex-start; }
.site-header .main-nav { margin-left: auto; }
