/* === arene_combats.css — Page combats arène (#arene-combats) === */

/* iOS Safari : élimine le délai 300ms du double-tap sur tous les éléments cliquables */
.ac-pkm-cell,
.ac-pkm-carte,
.ac-modal-pkm,
.ac-modal-bas,
.ac-combat-rapide-wrap,
.ac-info-btn,
.ac-combat-rapide-info,
#ac-modal-overlay,
#ac-combat-rapide-btn,
.ac-select,
.ac-filtre-label,
.ac-tous-ko-lien,
.ac-res-relancer,
.ac-res-retour {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Désactive le zoom au double-tap sur toute l'arène (aligné mobile.css) */
#arene-combats-wrapper,
#arene-combats-wrapper * {
    touch-action: manipulation;
    -ms-touch-action: manipulation;
}

/* ===== Conteneur principal (fond sombre = bloc résultat) ===== */
#arene-combats-wrapper {
    width: 686px;
    max-width: 100%;
    margin: 0 auto;
    font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    background: linear-gradient(135deg, #1a0a2e 0%, #2d1b4e 50%, #1a0a2e 100%);
    color: var(--text, #e8e0ff);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(var(--neon-rgb), 0.28);
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.25),
        0 20px 40px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(var(--neon-rgb), 0.12);
}

/* ===== Bannière ===== */
#ac-header-img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    object-position: center 40%;
    display: block;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

/* ===== Bandeau stats ===== */
#ac-stats-bandeau {
    background: rgba(0, 0, 0, 0.28);
    border: none;
    border-bottom: 1px solid rgba(var(--neon-rgb), 0.18);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    box-shadow: none;
}

.ac-stat-item {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text, #e8e0ff);
    border: 1px solid rgba(var(--neon-rgb), 0.28);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: default;
}

@media (hover: hover) and (pointer: fine) {
    .ac-stat-item:hover {
        transform: translateY(-1px);
        border-color: rgba(var(--neon-rgb), 0.5);
        box-shadow: 0 4px 14px rgba(var(--neon-rgb), 0.2);
        background: rgba(var(--neon-rgb), 0.14);
        color: var(--text, #e8e0ff);
    }
}

.ac-stat-item strong {
    color: #c4b5fd;
    font-weight: 700;
}

.ac-stat-sep {
    color: rgba(var(--neon-rgb), 0.45);
    font-weight: 400;
    font-size: 14px;
    user-select: none;
}

.ac-stat-rang strong {
    color: #fbbf24;
}

/* ===== Onglets Combats / Rang ===== */
#ac-onglets {
    display: flex;
    border-bottom: 1px solid rgba(var(--neon-rgb), 0.22);
    background: rgba(0, 0, 0, 0.2);
}

.ac-onglet-btn {
    flex: 1;
    border: none;
    border-right: 1px solid rgba(var(--neon-rgb), 0.15);
    background: transparent;
    color: var(--text, #e8e0ff);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    touch-action: manipulation;
}

.ac-onglet-btn:last-child {
    border-right: none;
}

@media (hover: hover) and (pointer: fine) {
    .ac-onglet-btn:hover {
        background: rgba(var(--neon-rgb), 0.12);
        color: var(--neon, #c4b5fd);
    }
}

.ac-onglet-btn.active {
    background: rgba(var(--neon-rgb), 0.22);
    color: var(--neon, #c4b5fd);
    box-shadow: inset 0 -2px 0 var(--neon, #a78bfa);
}

/* ===== Page Rang ===== */
.ac-rang-page {
    padding: 16px 18px 24px;
}

.ac-rang-hero {
    border: 1px solid rgba(var(--neon-rgb), 0.35);
    border-radius: 14px;
    padding: 16px 18px;
    background: rgba(0, 0, 0, 0.25);
    margin-bottom: 16px;
}

.ac-rang-hero-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(var(--neon-rgb), 0.75);
    margin-bottom: 6px;
}

.ac-rang-hero-nom {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 10px;
}

.ac-rang-hero-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: rgba(232, 224, 255, 0.9);
}

.ac-rang-hh {
    color: #fbbf24;
    font-weight: 600;
}

.ac-rang-prog {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(var(--neon-rgb), 0.18);
}

.ac-rang-prog-max {
    text-align: center;
    font-weight: 600;
    color: #fbbf24;
}

.ac-rang-prog-titre {
    font-size: 13px;
    margin-bottom: 8px;
}

.ac-rang-prog-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-bottom: 6px;
}

.ac-rang-prog-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}

.ac-rang-prog-meta {
    font-size: 12px;
    color: rgba(232, 224, 255, 0.75);
}

.ac-rang-infos {
    font-size: 12px;
    line-height: 1.55;
    color: rgba(232, 224, 255, 0.82);
    margin-bottom: 14px;
}

.ac-rang-infos p {
    margin: 0 0 8px;
}

.ac-rang-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.ac-rang-table th,
.ac-rang-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(var(--neon-rgb), 0.15);
    text-align: left;
    vertical-align: middle;
}

.ac-rang-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(var(--neon-rgb), 0.85);
    background: rgba(0, 0, 0, 0.2);
}

.ac-rang-row-actif {
    background: rgba(var(--neon-rgb), 0.1);
}

.ac-rang-puce {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.ac-rang-actif-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    background: rgba(var(--neon-rgb), 0.25);
    color: var(--neon, #c4b5fd);
}

/* ===== Page Badges (Panthéon) ===== */
.ac-badges-page {
    padding: 16px 18px 24px;
}

.ac-badges-hero {
    border: 1px solid rgba(var(--neon-rgb), 0.35);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
    background: rgba(var(--neon-rgb), 0.08);
}

.ac-badges-hero-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 8px;
}

.ac-badges-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    font-size: 13px;
    color: var(--text, #e8e0ff);
}

.ac-badges-hero-stats strong {
    color: var(--neon, #c4b5fd);
}

.ac-badges-claimable {
    color: #4ade80;
    font-weight: 700;
}

.ac-badges-infos {
    font-size: 12px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 14px;
}

.ac-badges-infos p {
    margin: 0 0 8px 0;
}

.ac-badges-infos p:last-child {
    margin-bottom: 0;
}

.ac-badges-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ac-badge-card {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid rgba(var(--neon-rgb), 0.28);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
}

.ac-badge-card-claimable {
    border-color: rgba(74, 222, 128, 0.45);
    box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.12);
}

.ac-badge-ico {
    width: 28px;
    height: 28px;
    object-fit: contain;
    image-rendering: pixelated;
}

.ac-badge-main {
    min-width: 0;
}

.ac-badge-title {
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.ac-badge-prog-meta {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.62);
    margin-bottom: 5px;
}

.ac-badge-prog-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.ac-badge-prog-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--neon, #a78bfa), #818cf8);
    transition: width 0.25s ease;
}

.ac-badge-stock {
    text-align: center;
    min-width: 52px;
}

.ac-badge-stock-num {
    display: block;
    font-size: 18px;
    font-weight: 900;
    color: #fbbf24;
    line-height: 1.1;
}

.ac-badge-stock-lbl {
    display: block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.04em;
}

.ac-badge-claim-tag {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

@media (max-width: 640px) {
    .ac-badges-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Résultat combat ===== */
#ac-resultat {
    margin-bottom: 0;
}

.ac-res-chargement {
    border-left: 4px solid var(--neon);
}

.ac-res-chargement-texte {
    font-size: 14px;
    font-weight: bold;
    color: var(--neon);
    animation: ac-combat-pulse 0.85s ease-in-out infinite alternate;
}

@keyframes ac-combat-pulse {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

.ac-resultat-bloc {
    padding: 14px 18px;
    border: none;
    border-bottom: 1px solid rgba(var(--neon-rgb), 0.15);
    background: linear-gradient(135deg, #1a0a2e 0%, #2d1b4e 50%, #1a0a2e 100%);
    color: var(--text, #e8e0ff);
    transition: box-shadow 0.3s ease;
    cursor: default;
}

@media (hover: hover) and (pointer: fine) {
    .ac-resultat-bloc:hover {
        box-shadow: inset 0 0 40px rgba(var(--neon-rgb), 0.08);
    }
}

.ac-res-victoire { border-left: 4px solid #22c55e; }
.ac-res-defaite  { border-left: 4px solid #ef4444; }

.ac-res-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ac-res-sprite-wrap {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    width: 60px;
    height: 60px;
}

.ac-res-sprite {
    width: 60px;
    height: 60px;
    object-fit: contain;
    image-rendering: pixelated;
    display: block;
}

.ac-res-sprite-flip {
    transform: scaleX(-1);
}

.ac-res-textes {
    flex: 1;
    text-align: center;
}

.ac-res-victoire .ac-res-titre {
    font-size: 14px;
    font-weight: bold;
    color: #4ade80;
    margin-bottom: 4px;
}

.ac-res-defaite .ac-res-titre {
    font-size: 14px;
    font-weight: bold;
    color: #f87171;
    margin-bottom: 4px;
}

.ac-res-ligne {
    margin: 3px 0;
    font-size: 12px;
    color: var(--text, #e0d5ff);
}

.ac-res-zygarde {
    margin-top: 8px;
    font-weight: 600;
    color: #c4b5fd;
    background: rgba(var(--neon-rgb), 0.18);
    border: 1px solid rgba(var(--neon-rgb), 0.35);
    padding: 4px 12px;
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
}

.ac-res-badge {
    margin-top: 8px;
    font-weight: 600;
    color: #fde68a;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.45);
    padding: 4px 12px;
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
}

/* ===== Équipe joueur ===== */
#ac-header {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(var(--neon-rgb), 0.12);
    padding: 16px 16px 14px;
    box-shadow: none;
}

.ac-equipe-cartes {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    align-items: stretch;
}

.ac-pkm-carte {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(var(--neon-rgb), 0.22);
    border-radius: 14px;
    padding: 8px 5px 10px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

@media (hover: hover) and (pointer: fine) {
    .ac-pkm-carte:hover {
        transform: translateY(-4px);
        border-color: rgba(var(--neon-rgb), 0.5);
        box-shadow: 0 8px 22px rgba(var(--neon-rgb), 0.22);
        background: rgba(var(--neon-rgb), 0.12);
    }

    .ac-pkm-carte:hover .ac-carte-nom,
    .ac-pkm-carte:hover .ac-carte-nom-txt,
    .ac-pkm-carte:hover .ac-carte-niv {
        color: #fff;
    }
}

.ac-carte-ko {
    opacity: 0.45;
    filter: grayscale(0.6);
}

.ac-carte-ko-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ef4444;
    font-weight: 900;
    font-size: 14px;
    letter-spacing: 2px;
    pointer-events: none;
}

.ac-carte-sprite-wrap {
    position: relative;
    width: 70px;
    height: 84px;
    margin: 0 auto 4px;
    flex-shrink: 0;
    overflow: visible;
}

.ac-carte-sprite-inner {
    width: 70px;
    height: 84px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.ac-carte-sprite {
    width: 70px;
    height: 70px;
    object-fit: contain;
    object-position: center bottom;
    image-rendering: pixelated;
    display: block;
    margin: 0 auto;
    flex-shrink: 0;
}

.ac-carte-sprite[data-sprite-scale] {
    transform: translateY(var(--pkm-sprite-offset-y, 0)) scale(var(--pkm-sprite-scale, 1));
    transform-origin: center bottom;
}

.ac-carte-sprite-wrap.aura-rouge-wrap,
.ac-pkm-cell-sprite-wrap.aura-rouge-wrap {
    filter: drop-shadow(0 0 4px #ff3333) drop-shadow(0 0 8px #cc0000);
}

#ac-pkm-joueur .ac-carte-sprite-wrap {
    margin-top: 2px;
}

.ac-carte-nom {
    font-size: 10px;
    font-weight: 600;
    color: var(--text, #e8e0ff);
    margin: 0 0 5px 0;
    transition: color 0.22s;
    width: 100%;
    min-width: 0;
    min-height: 36px;
    flex-shrink: 0;
    text-align: center;
}

.ac-carte-nom-txt {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    transition: color 0.22s;
}

.ac-carte-nom-badges {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 24px;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    margin: 0 0 4px 0;
}

.ac-carte-genre { font-size: 10px; margin: 1px 0; }

.ac-carte-types {
    margin: 2px 0 0;
    margin-top: auto;
    min-height: 32px;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex-shrink: 0;
}

.ac-carte-niv {
    font-size: 10px;
    color: #a99bc4;
    transition: color 0.22s;
    flex-shrink: 0;
}

.ac-carte-hp-bar {
    height: 4px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 999px;
    margin-top: 4px;
    overflow: hidden;
    width: 100%;
    flex-shrink: 0;
}

.ac-carte-hp-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s;
}

.ac-carte-xp-bar {
    height: 3px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 999px;
    margin-top: 2px;
    overflow: hidden;
    width: 100%;
    flex-shrink: 0;
}

.ac-carte-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon), #c084fc);
    border-radius: 999px;
    transition: width 0.3s;
}

.ac-genre-icon {
    width: 8px;
    height: 14px;
    object-fit: contain;
    vertical-align: middle;
}

.ac-badge {
    width: 14px;
    height: 14px;
    object-fit: contain;
    vertical-align: middle;
    margin-left: 1px;
}

.ac-badge-leg {
    font-size: 9px;
    font-weight: bold;
    color: #f5b305;
    background: rgba(245, 179, 5, 0.15);
    border-radius: 4px;
    padding: 1px 3px;
    vertical-align: middle;
}

/* Message tous KO */
.ac-tous-ko {
    text-align: center;
    padding: 20px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text, #e8e0ff);
}

.ac-tous-ko-lien {
    display: inline-block;
    margin-top: 8px;
    color: #c4b5fd;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px solid rgba(var(--neon-rgb), 0.35);
    padding-bottom: 1px;
    transition: color 0.2s, border-color 0.2s;
}

@media (hover: hover) and (pointer: fine) {
    .ac-tous-ko-lien:hover {
        color: var(--neon);
        border-color: var(--neon);
    }
}

/* ===== Filtres & outils ===== */
#ac-filtres {
    background: rgba(0, 0, 0, 0.18);
    border: none;
    border-top: 1px solid rgba(var(--neon-rgb), 0.14);
    border-bottom: 1px solid rgba(var(--neon-rgb), 0.14);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    box-shadow: none;
}

.ac-filtre-label {
    font-size: 12px;
    font-weight: 600;
    color: #c4b5fd;
    letter-spacing: 0.02em;
}

.ac-select {
    background: #2d1b4e;
    border: 1px solid rgba(var(--neon-rgb), 0.35);
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--text, #e8e0ff);
    cursor: pointer;
    outline: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
    transition: border-color 0.2s, box-shadow 0.2s;
    color-scheme: dark;
    appearance: auto;
}

.ac-select option {
    background: #1a0a2e;
    color: #e8e0ff;
}

#ac-filtre-niv.ac-select {
    min-width: 118px;
}

.ac-select:focus {
    border-color: rgba(var(--neon-rgb), 0.55);
    box-shadow: 0 0 0 3px rgba(var(--neon-rgb), 0.12);
}

.ac-combat-rapide-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    vertical-align: middle;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.ac-info-btn,
.ac-combat-rapide-info {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    padding: 0;
    margin-left: 2px;
    border-radius: 50%;
    border: 1px solid rgba(var(--neon-rgb), 0.55);
    background: rgba(var(--neon-rgb), 0.12);
    color: var(--neon, #c77dff);
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto;
}

#ac-combat-rapide-btn {
    font-weight: 600;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.ac-hebdo-compteur {
    font-size: 12px;
    white-space: nowrap;
    color: var(--text, #e8e0ff);
}

.ac-hebdo-compteur-n {
    color: #fff;
    font-weight: bold;
}

.ac-hebdo-compteur-n.ac-hebdo-compteur-over {
    color: #e74c3c;
}

#ac-zygarde-compteur {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ac-zygarde-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: help;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(var(--neon-rgb), 0.28);
    border-radius: 999px;
    padding: 4px 10px 4px 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.ac-zygarde-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.2s;
}

@media (hover: hover) and (pointer: fine) {
    .ac-zygarde-img:hover { transform: scale(1.15); }
}

.ac-zygarde-barre {
    width: 88px;
    height: 6px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 999px;
    overflow: hidden;
}

.ac-zygarde-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon), #c084fc);
    border-radius: 999px;
    transition: width 0.5s;
}

/* ===== PKM cachés ===== */
#ac-info-caches {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(var(--neon-rgb), 0.12);
    padding: 8px 16px;
    font-size: 12px;
    color: #a99bc4;
}

.ac-cache-nom {
    display: inline-block;
    margin: 2px 4px;
    padding: 3px 10px;
    background: rgba(var(--neon-rgb), 0.1);
    border: 1px solid rgba(var(--neon-rgb), 0.3);
    border-radius: 999px;
    color: #c4b5fd;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

@media (hover: hover) and (pointer: fine) {
    .ac-cache-nom:hover {
        background: var(--neon);
        color: #000;
        border-color: var(--neon);
    }
}

/* ===== Grille adversaires ===== */
#ac-grille {
    background: transparent;
    padding: 0;
}

.ac-pkm-grille {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
    border: none;
    background: transparent;
}

.ac-pkm-cell {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(var(--neon-rgb), 0.22);
    border-radius: 16px;
    padding: 12px 10px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
    position: relative;
    min-width: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

/* iOS : le tap doit viser la carte, pas l'image enfant */
.ac-pkm-cell * {
    pointer-events: none;
}

.ac-pkm-cell .ac-info-btn {
    pointer-events: auto;
}

.ac-pkm-cell .ac-cell-info {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    margin-left: 0;
}

#ac-zygarde-compteur .ac-zygarde-info {
    flex-shrink: 0;
    margin-left: 0;
}

.ac-modal-pkm:not(.ac-modal-pkm-ko):not(.ac-modal-pkm-vide) * {
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
    .ac-pkm-cell:hover {
        background: rgba(var(--neon-rgb), 0.12);
        border-color: rgba(var(--neon-rgb), 0.5);
        box-shadow: 0 10px 26px rgba(var(--neon-rgb), 0.22);
        transform: translateY(-4px);
    }

    .ac-pkm-cell:hover .ac-pkm-cell-nom,
    .ac-pkm-cell:hover .ac-pkm-cell-nom-txt,
    .ac-pkm-cell:hover .ac-pkm-cell-niv {
        color: #fff;
    }

    .ac-pkm-cell:hover .ac-sprite-adversaire { transform: scale(1.08); }
}

.ac-pkm-cell-sprite-wrap {
    position: relative;
    width: 70px;
    height: 70px;
    margin: 0 auto 6px;
    display: block;
}

.ac-sprite-adversaire {
    width: 70px;
    height: 70px;
    object-fit: contain;
    image-rendering: pixelated;
    display: block;
    margin: 0 auto;
    transition: transform 0.18s ease;
}

.ac-pkm-cell-nom {
    font-size: 12px;
    font-weight: 600;
    color: var(--text, #e8e0ff);
    margin-bottom: 2px;
    transition: color 0.22s;
    width: 100%;
    min-width: 0;
}

.ac-pkm-cell-nom-txt {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    transition: color 0.22s;
}

.ac-pkm-cell-types {
    margin: 2px 0 4px;
    min-height: 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 2px;
    box-sizing: border-box;
}

.ac-pkm-cell-badges {
    margin: 0 0 6px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 24px;
    box-sizing: border-box;
}

.ac-pkm-cell-niv {
    font-size: 11px;
    color: #a99bc4;
    transition: color 0.22s;
}

.ac-type-small {
    height: 14px;
    width: auto;
    vertical-align: middle;
    margin: 0 1px;
}

/* ===== Tooltip (modal + cartes) ===== */
.ac-tooltip {
    position: fixed;
    z-index: 100000;
    background: #fff;
    border: 2px solid rgba(var(--neon-rgb), 0.45);
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    color: #3d3555;
    line-height: 1.7;
    pointer-events: none;
    min-width: 150px;
    max-width: 220px;
    overflow: hidden;
    box-sizing: border-box;
}

.ac-tooltip strong {
    color: #1a0a2e;
}

/* ===== Modal choix PKM (theme sombre) ===== */
#ac-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 4, 18, 0.72);
    z-index: 9998;
}

#ac-modal {
    position: fixed;
    top: 48%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: linear-gradient(160deg, #1a0a2e 0%, #2d1b4e 55%, #1a0a2e 100%);
    border: 1px solid rgba(var(--neon-rgb), 0.35);
    border-radius: 18px;
    padding: 20px 22px;
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(var(--neon-rgb), 0.15);
    width: 320px;
    text-align: center;
    font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    color: var(--text, #e8e0ff);
    contain: layout style;
}

#ac-modal.ac-modal-busy .ac-modal-pkm,
#ac-modal.ac-modal-busy .ac-modal-bas,
#ac-modal.ac-modal-busy .ac-modal-cache {
    opacity: 0.55;
    pointer-events: none;
}

.ac-modal-titre {
    font-size: 14px;
    font-weight: 700;
    color: var(--text, #e8e0ff);
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(var(--neon-rgb), 0.22);
}

.ac-modal-equipe {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.ac-modal-equipe .ac-tous-ko {
    grid-column: 1 / -1;
}

.ac-modal-pkm {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(var(--neon-rgb), 0.22);
    border-radius: 12px;
    padding: 8px 6px;
    cursor: pointer;
    transition: border-color 0.1s, box-shadow 0.1s, transform 0.1s;
    text-align: center;
}

@media (hover: hover) and (pointer: fine) {
    .ac-modal-pkm:hover {
        border-color: rgba(var(--neon-rgb), 0.5);
        background: rgba(var(--neon-rgb), 0.12);
        box-shadow: 0 4px 14px rgba(var(--neon-rgb), 0.2);
        transform: translateY(-2px);
    }
}

.ac-modal-pkm-ko {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

@media (hover: hover) and (pointer: fine) {
    .ac-modal-pkm-ko:hover {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(var(--neon-rgb), 0.22);
        box-shadow: none;
        transform: none;
    }

    .ac-modal-pkm-vide:hover {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(var(--neon-rgb), 0.22);
        box-shadow: none;
        transform: none;
    }
}

.ac-modal-pkm-vide {
    cursor: default;
    opacity: 0.3;
}

.ac-sprite-modal {
    width: 64px;
    height: 64px;
    object-fit: contain;
    image-rendering: pixelated;
    display: block;
    margin: 0 auto;
}

.ac-modal-bas {
    font-size: 12px;
    color: #c4b5fd;
    cursor: pointer;
    text-decoration: none;
    border-top: none;
    padding-top: 0;
    display: inline-block;
    margin: 0 6px;
    border-bottom: 1px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.ac-modal-actions {
    border-top: 1px solid rgba(var(--neon-rgb), 0.18) !important;
}

@media (hover: hover) and (pointer: fine) {
    .ac-modal-bas:hover {
        color: var(--neon);
        border-bottom-color: rgba(var(--neon-rgb), 0.45);
    }
}
