/* --- Profile Arena --- */
.profile-arena {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.8rem;
    height: 100%;
}
.profile-arena-bg {
    position: absolute;
    inset: 0;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    z-index: 0;
    transition: background-image 0.4s ease;
}
.profile-bg-switch {
    position: absolute;
    bottom: 0.7rem;
    left: 0.8rem;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 16px;
    background: rgba(var(--bg-body-rgb), 0.6);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(var(--gold-rgb), 0.25);
    color: var(--text-main);
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.profile-bg-switch:hover {
    background: rgba(var(--bg-body-rgb), 0.8);
    border-color: rgba(var(--gold-rgb), 0.55);
    transform: translateY(-1px);
}
.profile-bg-switch:active { transform: translateY(0); }
.profile-bg-switch-icon {
    width: 14px; height: 14px;
    display: inline-block;
    border: 1.5px solid rgba(var(--gold-rgb), 0.85);
    border-top-color: transparent;
    border-radius: 50%;
    position: relative;
}
.profile-bg-switch-icon::after {
    content: '';
    position: absolute;
    top: -3px; right: -2px;
    width: 0; height: 0;
    
    
    border-bottom: 3px solid transparent;
}
.profile-bg-switch-label {
    color: rgba(var(--gold-rgb), 0.9);
    font-variant-numeric: tabular-nums;
}
.profile-arena-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center 60%, transparent 30%, rgba(var(--bg-body-rgb),0.85) 80%),
        linear-gradient(180deg, rgba(var(--bg-body-rgb),0.3) 0%, rgba(var(--bg-body-rgb),0.6) 100%);
    z-index: 1;
}

/* V/D float badge */
.profile-record-float {
    position: absolute;
    top: 0.6rem;
    right: 0.8rem;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(var(--bg-body-rgb),0.6);
    backdrop-filter: blur(6px);
    padding: 0.3rem 0.7rem;
    border-radius: 16px;
    border: 1px solid rgba(var(--gold-rgb),0.15);
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 700;
}
.profile-record-float .wins { color: var(--success); }
.profile-record-float .record-sep { color: var(--gray-800); font-weight: 400; }
.profile-record-float .losses { color: var(--error); }

/* --- Showcase: two panels side by side --- */
.profile-showcase {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    flex: 0 1 auto;
    min-height: 0;
    padding: 1rem 1.5rem;
}

/* =============================================
   Barre Équipement du Gardien
   3 slots centres sous les 2 panels, largeur limitee.
   ============================================= */
.profile-guardian-bar {
    position: relative;
    z-index: 2;
    align-self: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 24px 14px;
    background: rgba(var(--bg-body-rgb), 0.82);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(var(--gold-rgb), 0.18);
    border-radius: 14px;
    max-width: 520px;
    margin: 0 auto 0.4rem;
}
.profile-guardian-bar-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.profile-guardian-bar-title {
    font-family: 'Cinzel', serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1.4px;
}
.profile-guardian-bar-slots {
    display: flex;
    gap: 14px;
    justify-content: center;
}
/* Slots Gardien : reutilisent la DA des slots écailles */
.profile-guardian-bar-slots .profile-slot.guardian-slot {
    width: 72px;
    height: 72px;
    min-height: 72px;
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
    flex: 0 0 auto;
    position: relative;
    cursor: pointer;
}
.profile-slot.guardian-slot-empty {
    border: 2px dashed rgba(var(--white-rgb), 0.12);
    background: rgba(var(--white-rgb), 0.02);
}
.profile-slot.guardian-slot-empty:hover {
    border-color: rgba(var(--gold-rgb), 0.5);
    background: rgba(var(--gold-rgb), 0.05);
}
.profile-slot.guardian-slot-empty .slot-empty-label {
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(var(--gold-rgb), 0.35);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    text-align: center;
}
.profile-slot.guardian-slot-filled {
    background: linear-gradient(135deg, var(--bg-profile) 0%, var(--bg-profile-end) 100%);
    border-width: 2px;
}
.profile-slot.guardian-slot-filled:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(var(--black-rgb), 0.5);
}
.profile-slot.guardian-slot-filled .slot-icon {
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 2px 4px rgba(var(--black-rgb), 0.6));
    image-rendering: pixelated;
}
.profile-slot.guardian-tier-1 { --rarity-color: var(--rarity-fragile);    border-color: var(--rarity-fragile);    box-shadow: 0 0 10px rgba(var(--rarity-fragile-rgb),    0.25) inset; }
.profile-slot.guardian-tier-2 { --rarity-color: var(--rarity-robuste);    border-color: var(--rarity-robuste);    box-shadow: 0 0 10px rgba(var(--rarity-robuste-rgb),    0.30) inset, 0 0 8px  rgba(var(--rarity-robuste-rgb),    0.40); }
.profile-slot.guardian-tier-3 { --rarity-color: var(--rarity-alpha);      border-color: var(--rarity-alpha);      box-shadow: 0 0 12px rgba(var(--rarity-alpha-rgb),      0.35) inset, 0 0 10px rgba(var(--rarity-alpha-rgb),      0.50); }
.profile-slot.guardian-tier-4 { --rarity-color: var(--rarity-ancien);     border-color: var(--rarity-ancien);     box-shadow: 0 0 14px rgba(var(--rarity-ancien-rgb),     0.40) inset, 0 0 12px rgba(var(--rarity-ancien-rgb),     0.60); }
.profile-slot.guardian-tier-5 { --rarity-color: var(--rarity-primordial); border-color: var(--rarity-primordial); box-shadow: 0 0 16px rgba(var(--rarity-primordial-rgb), 0.45) inset, 0 0 16px rgba(var(--rarity-primordial-rgb), 0.70); animation: aura-pulse-t5 2s ease-in-out infinite; }
.profile-slot.guardian-tier-6 { --rarity-color: var(--rarity-primordial_pur); border-color: var(--rarity-primordial_pur); box-shadow: 0 0 18px rgba(var(--rarity-primordial_pur-rgb), 0.50) inset, 0 0 18px rgba(var(--rarity-primordial_pur-rgb), 0.75); animation: aura-pulse-t6 2.5s ease-in-out infinite; }

/* Pill "Expédition" : tag vert discret */
.profile-equip-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px 2px 6px;
    font-family: 'Oswald', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.6px;
    color: #9be6a3;
    background: rgba(60, 140, 70, 0.18);
    border: 1px solid rgba(120, 200, 130, 0.4);
    border-radius: 999px;
    cursor: help;
}
.profile-equip-tag-icon {
    width: 13px;
    height: 13px;
    image-rendering: pixelated;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5));
}

/* =============================================
   PANEL GAUCHE : Carte Dragon
   ============================================= */
.profile-dragon-card {
    position: relative;
    z-index: 2;
    border-radius: 12px;
    padding: 0;
    background: transparent;
    border: 1px solid rgba(var(--gold-rgb), 0.15);
}

.dragon-card-inner {
    position: relative;
    background: rgba(var(--bg-body-rgb),0.92);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.8rem 3.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
}
.dragon-visual {
    position: relative;
    display: inline-block;
}
.dragon-visual-glow {
    position: absolute;
    top: -30px; left: -30px; right: -30px; bottom: -30px;
    border-radius: 50%;
    pointer-events: none;
    animation: glowPulse 3s ease-in-out infinite;
}
@keyframes glowPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}
#dragon-preview {
    display: block;
       position: relative;
    z-index: 1;
    width: 375px;
    height: 375px;
}
.dragon-identity { text-align: center; }
.dragon-name {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: var(--gold);
    font-size: 2.2rem;
    margin: 0 0 0.3rem;
    text-shadow: 0 0 15px rgba(var(--gold-rgb),0.3), 0 2px 4px rgba(var(--black-rgb),0.5);
}
.dragon-species-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}
.dragon-species-name {
    font-family: 'Oswald', sans-serif;
    font-size: 1.2rem;
    color: var(--text-brown);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dragon-species {
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    color: var(--text-brown);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}
.dragon-lore {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 0.85rem;
    color: var(--text-brown);
    font-style: italic;
    margin: 0.2rem 0 0.5rem;
    line-height: 1.4;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}
.dragon-rarity-badge {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    border: 1px solid;
    letter-spacing: 1px;
}
.dragon-rarity-corner {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
}

/* Badge puissance (PWR) — generique, partage entre carte profil et cards PvP.
   Restaure depuis backup v1 (avant refonte 2026-05-09). */
.pvp-card-power {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 4px 8px;
    background: linear-gradient(145deg, rgba(var(--gold-rgb),0.22), rgba(var(--black-rgb),0.55));
    border: 1px solid rgba(var(--gold-rgb),0.5);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(var(--black-rgb),0.5), inset 0 1px 0 rgba(var(--white-rgb),0.1);
    font-family: 'Cinzel', serif;
    line-height: 1;
}
.pvp-power-label {
    font-size: 0.55rem;
    letter-spacing: 1.5px;
    color: var(--gold);
    font-weight: 600;
    opacity: 0.85;
}
.pvp-power-val {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold-text-light);
    text-shadow: 0 0 6px rgba(var(--gold-rgb),0.5);
    margin-top: 2px;
}
#adv-diff-hint { display: none; }
.dragon-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}
.dragon-element-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 1rem;
    border-radius: 6px;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: 'Oswald', sans-serif;
}
.dragon-element-tag .icon-btn-sm {
    width: 32px;
    height: 32px;
}
.element-fire { background: rgba(var(--elem-fire-rgb),0.25); color: var(--elem-fire); }
.element-water { background: rgba(var(--blue-rgb),0.25); color: var(--blue); }
.element-earth { background: rgba(var(--elem-earth-rgb),0.25); color: var(--elem-earth); }
.element-lightning { background: rgba(var(--elem-lightning-rgb),0.25); color: var(--elem-lightning); }
.element-wind { background: rgba(var(--elem-wind-rgb),0.25); color: var(--elem-wind); }
.element-tenebres { background: rgba(var(--elem-tenebres-rgb),0.25); color: var(--elem-tenebres); }
.element-glace { background: rgba(var(--elem-glace-rgb),0.25); color: var(--elem-glace); }
.element-plante { background: rgba(var(--elem-plante-rgb),0.25); color: var(--elem-plante); }
.element-explosion { background: rgba(var(--elem-explosion-rgb),0.25); color: var(--elem-explosion); }
.element-boue { background: rgba(var(--elem-boue-rgb),0.25); color: var(--elem-boue); }
.dragon-level-badge {
    color: var(--text-secondary);
    font-size: 1.45rem;
    font-family: 'Oswald', sans-serif;
    background: rgba(var(--white-rgb),0.06);
    padding: 0.35rem 0.9rem;
    border-radius: 6px;
}

/* XP bar inside dragon card */
.dragon-card-xp {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.5rem;
    padding-top: 0.6rem;
}
.dragon-card-xp-label {
    font-family: 'Oswald', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    white-space: nowrap;
}
.dragon-card-xp-bar {
    flex: 1;
    height: 18px;
    background: rgba(var(--white-rgb),0.08);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.dragon-card-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--stat-blue-dark), var(--stat-blue-light));
    border-radius: 4px;
    transition: width 0.6s ease;
}
.dragon-card-xp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Oswald', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    text-shadow: 0 0 3px var(--black);
}

/* =============================================
   PANEL DROIT : Stats / Comp / Equip
   ============================================= */
/* =============================================
   PANEL DROIT
   ============================================= */
.profile-info-panel {
    background: rgba(var(--bg-body-rgb),0.8);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    border: 1px solid rgba(var(--gold-rgb),0.15);
    padding: 2.1rem;
}

/* Grille 6 icones stats decoratives 3x2 */
.pstat-icons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.pstat-icon-badge {
    aspect-ratio: 1;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(var(--white-rgb),0.08);
    background: rgba(var(--white-rgb),0.03);
    position: relative;
    overflow: hidden;
}
.pstat-icon-badge img {
    width: 38px;
    height: 38px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 6px rgba(var(--black-rgb),0.6));
}
.pstat-icon-badge::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.15;
    border-radius: 10px;
}
.pstat-badge-red    { border-color: rgba(var(--stat-red-rgb),0.3); }
.pstat-badge-red::before    { background: radial-gradient(circle, var(--stat-red), transparent 70%); }
.pstat-badge-orange { border-color: rgba(var(--stat-orange-rgb),0.3); }
.pstat-badge-orange::before { background: radial-gradient(circle, var(--stat-orange), transparent 70%); }
.pstat-badge-green  { border-color: rgba(var(--stat-green-rgb),0.3); }
.pstat-badge-green::before  { background: radial-gradient(circle, var(--stat-green), transparent 70%); }
.pstat-badge-blue   { border-color: rgba(var(--stat-blue-rgb),0.3); }
.pstat-badge-blue::before   { background: radial-gradient(circle, var(--stat-blue), transparent 70%); }
.pstat-badge-yellow { border-color: rgba(var(--stat-yellow-rgb),0.3); }
.pstat-badge-yellow::before { background: radial-gradient(circle, var(--stat-yellow), transparent 70%); }
.pstat-badge-cyan   { border-color: rgba(var(--stat-cyan-rgb),0.3); }
.pstat-badge-cyan::before   { background: radial-gradient(circle, var(--stat-cyan), transparent 70%); }

/* Stats barres lisses */
.pstat-bars {
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.pstat-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pstat-row-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}
.pstat-name {
    min-width: 72px;
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pstat-track {
    flex: 1;
    height: 22px;
    background: rgba(var(--white-rgb),0.06);
    border-radius: 6px;
    overflow: visible;
    position: relative;
    position: relative;
}
.pstat-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 6px;
    transition: width 0.8s ease;
    overflow: visible;
}
.pstat-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(var(--white-rgb),0.25), transparent);
    border-radius: 6px 6px 0 0;
}
.pstat-red    { background: linear-gradient(90deg, var(--stat-red-dark), var(--stat-red-light)); }
.pstat-orange { background: linear-gradient(90deg, var(--stat-orange-dark), var(--stat-orange-light)); }
.pstat-green  { background: linear-gradient(90deg, var(--stat-green-dark), var(--stat-green-light)); }
.pstat-blue   { background: linear-gradient(90deg, var(--stat-blue-dark), var(--stat-blue-light)); }
.pstat-yellow { background: linear-gradient(90deg, var(--stat-yellow-dark), var(--stat-yellow-light)); }
.pstat-cyan   { background: linear-gradient(90deg, var(--stat-cyan-dark), var(--stat-cyan-light)); }

/* Progressive glow - rarity colors: fragile → robuste → alpha → ancien → primordial */
.pstat-glow-1::before { /* 35%+ - fragile grey */
    content: '';
    position: absolute; right: -3px; top: 50%; transform: translateY(-50%);
    width: 8px; height: 18px; border-radius: 50%;
    background: radial-gradient(ellipse, rgba(var(--rarity-fragile-rgb),0.5), transparent 70%);
    filter: blur(2px); z-index: 2;
}
.pstat-glow-2::before { /* 50%+ - robuste blue */
    content: '';
    position: absolute; right: -3px; top: 50%; transform: translateY(-50%);
    width: 10px; height: 20px; border-radius: 50%;
    background: radial-gradient(ellipse, rgba(var(--blue-rgb),0.6), transparent 70%);
    filter: blur(2px); z-index: 2;
}
.pstat-glow-3::before { /* 70%+ - alpha purple */
    content: '';
    position: absolute; right: -4px; top: 50%; transform: translateY(-50%);
    width: 12px; height: 22px; border-radius: 50%;
    background: radial-gradient(ellipse, rgba(var(--rarity-alpha-rgb),0.7), transparent 70%);
    filter: blur(3px); z-index: 2;
}
.pstat-glow-4::before { /* 85%+ - ancien red */
    content: '';
    position: absolute; right: -4px; top: 50%; transform: translateY(-50%);
    width: 14px; height: 24px; border-radius: 50%;
    background: radial-gradient(ellipse, rgba(var(--orange-rgb),0.8), transparent 70%);
    filter: blur(3px); z-index: 2;
    animation: pstatGlow4 2s ease-in-out infinite;
}
.pstat-glow-5::before { /* 95%+ - primordial orange */
    content: '';
    position: absolute; right: -4px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 28px; border-radius: 50%;
    background: radial-gradient(ellipse, rgba(var(--red-rgb),0.9), rgba(255,200,60,0.4) 50%, transparent 70%);
    filter: blur(3px); z-index: 2;
    animation: pstatGlow5 1.6s ease-in-out infinite;
}
@keyframes pstatGlow4 {
    0%, 100% { opacity: 0.7; transform: translateY(-50%) scale(1); }
    50%      { opacity: 1; transform: translateY(-50%) scale(1.2); }
}
@keyframes pstatGlow5 {
    0%, 100% { opacity: 0.8; transform: translateY(-50%) scale(1); }
    50%      { opacity: 1; transform: translateY(-50%) scale(1.4); }
}

.pstat-val {
    position: absolute;
    left: 8px;
    top: 0;
    height: 100%;
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    z-index: 2;
    text-shadow: -1px -1px 0 var(--black), 1px -1px 0 var(--black), -1px 1px 0 var(--black), 1px 1px 0 var(--black), 0 0 4px rgba(var(--black-rgb),0.9);
    justify-content: flex-end;
    gap: 6px;
}
/* Sub-sections */
.profile-sub-section {
    padding-top: 0.7rem;
}
.profile-sub-title {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gold);
    margin: 0 0 8px;
    text-align: center;
}
.profile-slots-row {
    display: flex;
    gap: 15px;
    justify-content: center;
}
.profile-slot {
    width: 84px;
    height: 84px;
    border-radius: 14px;
    background: rgba(var(--white-rgb),0.03);
    border: 2px solid rgba(var(--white-rgb),0.07);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s;
}
.profile-slot:hover {
    border-color: rgba(var(--gold-rgb),0.3);
}
.comp-slot-passive {
    border-color: rgba(var(--gold-rgb),0.35);
    background: rgba(var(--gold-rgb),0.06);
}
.profile-slot .slot-ghost {
    width: 42px;
    height: 42px;
    opacity: 0.12;
    filter: grayscale(1);
}
.profile-slot .slot-label {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
}

/* Equipment slots filled state */
.profile-slot.equip-slot {
    position: relative;
    cursor: pointer;
}
.profile-slot.equip-slot-empty:hover {
    border-color: rgba(var(--gold-rgb),0.5);
    background: rgba(var(--gold-rgb),0.05);
}
.profile-slot.equip-slot-filled {
    background: linear-gradient(135deg, var(--bg-profile) 0%, var(--bg-profile-end) 100%);
    border-width: 2px;
}
.profile-slot.equip-slot-filled:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(var(--black-rgb),0.5);
}
.profile-slot.equip-slot-filled .slot-icon {
    width: 56px;
    height: 56px;
       filter: drop-shadow(0 2px 4px rgba(var(--black-rgb),0.6));
}
.profile-slot.equip-tier-1 { --rarity-color: var(--rarity-fragile); border-color: var(--rarity-fragile); box-shadow: 0 0 10px rgba(var(--rarity-fragile-rgb),0.25) inset; }
.profile-slot.equip-tier-2 { --rarity-color: var(--rarity-robuste); border-color: var(--rarity-robuste); box-shadow: 0 0 10px rgba(var(--rarity-robuste-rgb),0.3) inset, 0 0 8px rgba(var(--rarity-robuste-rgb),0.4); }
.profile-slot.equip-tier-3 { --rarity-color: var(--rarity-alpha); border-color: var(--rarity-alpha); box-shadow: 0 0 12px rgba(var(--rarity-alpha-rgb),0.35) inset, 0 0 10px rgba(var(--rarity-alpha-rgb),0.5); }
.profile-slot.equip-tier-4 { --rarity-color: var(--rarity-ancien); border-color: var(--rarity-ancien); box-shadow: 0 0 14px rgba(var(--rarity-ancien-rgb),0.4) inset, 0 0 12px rgba(var(--rarity-ancien-rgb),0.6); }
.profile-slot.equip-tier-5 { --rarity-color: var(--rarity-primordial); border-color: var(--rarity-primordial); box-shadow: 0 0 16px rgba(var(--rarity-primordial-rgb),0.45) inset, 0 0 16px rgba(var(--rarity-primordial-rgb),0.7); animation: aura-pulse-t5 2s ease-in-out infinite; }
.profile-slot.equip-tier-6 { --rarity-color: var(--rarity-primordial_pur, #22d3ee); border-color: var(--rarity-primordial_pur, #22d3ee); box-shadow: 0 0 18px rgba(var(--rarity-primordial_pur-rgb, 34, 211, 238),0.55) inset, 0 0 18px rgba(var(--rarity-primordial_pur-rgb, 34, 211, 238),0.7); animation: aura-pulse-t6 2.5s ease-in-out infinite; }
/* Etendu aux .reserve-cell et .reserve-equip-slot pour le meme badge tier
   dans la modal Reserve que sur les slots du Profil. */
.profile-slot .equip-tier-badge,
.reserve-cell .equip-tier-badge,
.reserve-equip-slot .equip-tier-badge {
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-family: 'Oswald', sans-serif;
    font-size: 11px;
    font-weight: 800;
    color: var(--rarity-color, #fff);
    background: rgba(var(--black-rgb), 0.85);
    padding: 1px 6px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    text-shadow:
        0 0 6px var(--rarity-color, transparent),
        0 0 2px rgba(0, 0, 0, 0.9);
}

/* 5-slots row : taille un poil reduite pour tenir sans scroll */
.profile-slots-row.profile-slots-row-5 {
    gap: 10px;
}
.profile-slots-row.profile-slots-row-5 .profile-slot {
    width: 72px;
    height: 72px;
}
.profile-slots-row.profile-slots-row-5 .profile-slot.equip-slot-filled .slot-icon {
    width: 46px;
    height: 46px;
}

/* Locked slot (niveau dragon insuffisant) */
.profile-slot.equip-slot-locked {
    background: repeating-linear-gradient(45deg, rgba(var(--black-rgb),0.4) 0 8px, rgba(var(--black-rgb),0.25) 8px 16px);
    border: 2px dashed rgba(var(--gold-rgb), 0.25);
    cursor: help;
    flex-direction: column;
    gap: 4px;
}
.profile-slot.equip-slot-locked:hover {
    border-color: rgba(var(--gold-rgb), 0.5);
    background: repeating-linear-gradient(45deg, rgba(var(--gold-rgb),0.08) 0 8px, rgba(var(--black-rgb),0.25) 8px 16px);
}
.profile-slot.equip-slot-locked .slot-lock-svg {
    color: rgba(var(--gold-rgb), 0.55);
    filter: drop-shadow(0 1px 2px rgba(var(--black-rgb),0.6));
}
.profile-slot.equip-slot-locked .equip-lock-level {
    font-family: 'Cinzel', serif;
    font-size: 10px;
    color: var(--gold);
    font-weight: 700;
    letter-spacing: 0.4px;
    text-shadow: 0 1px 2px rgba(var(--black-rgb),0.7);
}

/* Empty slot : numero du slot en watermark */
.profile-slot .slot-empty-num {
    font-family: 'Cinzel', serif;
    font-size: 28px;
    font-weight: 700;
    color: rgba(var(--gold-rgb), 0.12);
    letter-spacing: 1px;
    user-select: none;
}

/* Bonus percent badge */
/* Etendu aux .reserve-cell et .reserve-equip-slot pour avoir strictement
   le meme badge dans la modal Reserve que sur les slots du Profil. */
.profile-slot .equip-bonus-badge,
.reserve-cell .equip-bonus-badge,
.reserve-equip-slot .equip-bonus-badge {
    position: absolute;
    top: 3px;
    left: 4px;
    font-family: 'Oswald', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: var(--stat-positive);
    background: rgba(0, 30, 0, 0.82);
    padding: 1px 5px;
    border-radius: 5px;
    border: 1px solid rgba(125, 255, 125, 0.35);
    text-shadow: 0 0 4px rgba(125, 255, 125, 0.5);
    letter-spacing: 0.3px;
    line-height: 1.2;
}

/* Doublon : tint rouge sur le bonus pour signaler la penalite */
.profile-slot.equip-duplicate .equip-bonus-badge {
    color: var(--stat-negative);
    border-color: rgba(255, 120, 80, 0.4);
    background: rgba(40, 0, 0, 0.85);
    text-shadow: 0 0 4px rgba(255, 120, 80, 0.5);
}
.profile-slot.equip-duplicate::after {
    content: '!';
    position: absolute;
    top: 3px;
    right: 6px;
    font-family: 'Cinzel', serif;
    font-size: 12px;
    font-weight: 700;
    color: var(--stat-negative);
    background: rgba(40,0,0,0.85);
    width: 14px;
    height: 14px;
    line-height: 14px;
    text-align: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 120, 80, 0.5);
}

/* Flash message au clic sur un slot verrouille */
.profile-slot .slot-flash {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 28, 0.95);
    border: 1px solid var(--gold);
    color: var(--gold-light);
    font-family: 'Oswald', sans-serif;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 5px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(var(--black-rgb),0.6);
    animation: slotFlashFade 1.8s ease-out forwards;
    pointer-events: none;
    z-index: 10;
}
@keyframes slotFlashFade {
    0%   { opacity: 0; transform: translate(-50%, 4px); }
    15%  { opacity: 1; transform: translate(-50%, 0); }
    75%  { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -4px); }
}

/* Stats bonus indicator */
.pstat-bonus {
    color: var(--stat-positive);
    font-weight: 700;
    font-size: 0.85em;
    text-shadow: -1px -1px 0 var(--black), 1px -1px 0 var(--black), -1px 1px 0 var(--black), 1px 1px 0 var(--black), 0 0 4px rgba(var(--black-rgb),0.9);
}

/* Inventory equipped badge */
.inv-item.inv-equipped {
    box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(var(--gold-rgb),0.3);
}
.inv-equipped-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

/* Equip slot picker (inventory → pick slot 1-5)
   DA "Plaque d'obsidienne tiède", layout liste verticale (cohérent avec scale-picker).
   Chaque ligne = 1 slot. Affiche l'écaille équipée (icône + stat + bonus + tier) ou
   "vide / Équiper" sinon. Anti-aveugle : on voit ce qu'on remplace avant de cliquer. */
.equip-slot-picker {
    background: linear-gradient(165deg, #1c1815 0%, #120f0d 55%, #0b0908 100%);
    border: 1px solid rgba(var(--gold-rgb), 0.55);
    border-radius: 10px;
    padding: 14px;
    width: 320px;
    box-shadow:
        inset 0 1px 0 rgba(var(--gold-rgb), 0.22),
        inset 0 -10px 14px -10px rgba(0, 0, 0, 0.55),
        0 1px 0 rgba(0, 0, 0, 0.5),
        0 14px 36px -8px rgba(0, 0, 0, 0.85),
        0 0 24px rgba(var(--gold-rgb), 0.12);
}
.equip-slot-picker-title {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    color: var(--gold-text-warm);
    text-shadow:
        0 1px 0 rgba(0, 0, 0, 0.85),
        0 0 10px rgba(var(--gold-rgb), 0.18);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(var(--gold-rgb), 0.18);
    text-align: center;
}
.equip-slot-picker-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.equip-slot-picker-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: linear-gradient(165deg, #1c1815 0%, #120f0d 55%, #0b0908 100%);
    border: 1px solid rgba(var(--gold-rgb), 0.22);
    border-left-width: 3px;
    border-left-color: rgba(var(--gold-rgb), 0.22);
    border-radius: 10px;
    color: var(--gold-text-warm);
    cursor: pointer;
    text-align: left;
    box-shadow:
        inset 0 1px 0 rgba(var(--gold-rgb), 0.1),
        inset 0 -8px 12px -10px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(0, 0, 0, 0.5),
        0 2px 6px -2px rgba(0, 0, 0, 0.4);
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.25s ease,
        transform 0.18s ease;
}
.equip-slot-picker-btn:hover {
    background: linear-gradient(165deg, #241e19 0%, #181310 55%, #0d0a08 100%);
    border-color: rgba(var(--gold-rgb), 0.7);
    box-shadow:
        inset 0 1px 0 rgba(var(--gold-rgb), 0.28),
        inset 0 -8px 12px -10px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(0, 0, 0, 0.5),
        0 4px 12px -2px rgba(0, 0, 0, 0.5),
        0 0 14px rgba(var(--gold-rgb), 0.22);
    transform: translateY(-1px);
}
.equip-slot-picker-btn:hover .esp-action {
    color: var(--gold-text-light);
}
.equip-slot-picker-btn .esp-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}
.equip-slot-picker-btn .esp-icon-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--gold-rgb), 0.06);
    border: 1px dashed rgba(var(--gold-rgb), 0.3);
    border-radius: 8px;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 700;
    color: rgba(var(--gold-rgb), 0.45);
}
.equip-slot-picker-btn .esp-info {
    flex: 1;
    min-width: 0;
}
.equip-slot-picker-btn .esp-row1 {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.equip-slot-picker-btn .esp-slot-label {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gold-text-warm);
    letter-spacing: 0.02em;
}
.equip-slot-picker-btn .esp-tier {
    font-family: 'Oswald', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}
.equip-slot-picker-btn .esp-bonus {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 0.74rem;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.equip-slot-picker-btn .esp-bonus-empty {
    font-style: italic;
    opacity: 0.6;
}
.equip-slot-picker-btn .esp-action {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gold-text-warm);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    flex-shrink: 0;
    transition: color 0.2s ease;
}
.equip-slot-picker-btn .esp-action-empty {
    color: rgba(var(--gold-rgb), 0.5);
}

/* Stripe gauche colorée par tier de l'écaille équipée + label "Tier" coloré
   (cohérent avec scale-picker - signal de rareté en 2 endroits, sans glow). */
.equip-slot-picker-btn.inv-tier-1 { border-left-color: var(--rarity-fragile); }
.equip-slot-picker-btn.inv-tier-1 .esp-tier { color: var(--rarity-fragile); }
.equip-slot-picker-btn.inv-tier-2 { border-left-color: var(--rarity-robuste); }
.equip-slot-picker-btn.inv-tier-2 .esp-tier { color: var(--rarity-robuste); }
.equip-slot-picker-btn.inv-tier-3 { border-left-color: var(--rarity-alpha); }
.equip-slot-picker-btn.inv-tier-3 .esp-tier { color: var(--rarity-alpha); }
.equip-slot-picker-btn.inv-tier-4 { border-left-color: var(--rarity-ancien); }
.equip-slot-picker-btn.inv-tier-4 .esp-tier { color: var(--rarity-ancien); }
.equip-slot-picker-btn.inv-tier-5 { border-left-color: var(--rarity-primordial); }
.equip-slot-picker-btn.inv-tier-5 .esp-tier { color: var(--rarity-primordial); }
.equip-slot-picker-btn.inv-tier-6 { border-left-color: var(--rarity-primordial_pur); }
.equip-slot-picker-btn.inv-tier-6 .esp-tier { color: var(--rarity-primordial_pur); }

/* Scale picker (profile slot → pick scale from inventory)
   DA "Plaque d'obsidienne tiède" - alignée sur components.css.
   Container : fond obsidienne 165deg + liseré or 0.55 + multi-shadow.
   Items : variante compacte du primary, hover qui s'éclaire (lift + halo or). */
.scale-picker {
    background: linear-gradient(165deg, #1c1815 0%, #120f0d 55%, #0b0908 100%);
    border: 1px solid rgba(var(--gold-rgb), 0.55);
    border-radius: 10px;
    padding: 14px;
    width: 320px;
    max-height: 400px;
    box-shadow:
        inset 0 1px 0 rgba(var(--gold-rgb), 0.22),
        inset 0 -10px 14px -10px rgba(0, 0, 0, 0.55),
        0 1px 0 rgba(0, 0, 0, 0.5),
        0 14px 36px -8px rgba(0, 0, 0, 0.85),
        0 0 24px rgba(var(--gold-rgb), 0.12);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}
.scale-picker-title {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    color: var(--gold-text-warm);
    text-shadow:
        0 1px 0 rgba(0, 0, 0, 0.85),
        0 0 10px rgba(var(--gold-rgb), 0.18);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(var(--gold-rgb), 0.18);
    text-align: center;
}
.scale-picker-list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    /* Scrollbar cohérente avec le reste du jeu (var globales). */
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--gold-rgb), 0.3) transparent;
}
.scale-picker-list::-webkit-scrollbar { width: 6px; }
.scale-picker-list::-webkit-scrollbar-thumb {
    background: rgba(var(--gold-rgb), 0.3);
    border-radius: 3px;
}
.scale-picker-empty {
    color: var(--text-secondary);
    font-family: 'Roboto Condensed', sans-serif;
    font-style: italic;
    text-align: center;
    padding: 20px 0;
}
.scale-picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(165deg, #1c1815 0%, #120f0d 55%, #0b0908 100%);
    border: 1px solid rgba(var(--gold-rgb), 0.22);
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    text-align: left;
    box-shadow:
        inset 0 1px 0 rgba(var(--gold-rgb), 0.1),
        inset 0 -8px 12px -10px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(0, 0, 0, 0.5),
        0 2px 6px -2px rgba(0, 0, 0, 0.4);
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.25s ease,
        transform 0.18s ease;
}
.scale-picker-item:hover {
    background: linear-gradient(165deg, #241e19 0%, #181310 55%, #0d0a08 100%);
    border-color: rgba(var(--gold-rgb), 0.7);
    box-shadow:
        inset 0 1px 0 rgba(var(--gold-rgb), 0.28),
        inset 0 -8px 12px -10px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(0, 0, 0, 0.5),
        0 4px 12px -2px rgba(0, 0, 0, 0.5),
        0 0 14px rgba(var(--gold-rgb), 0.22);
    transform: translateY(-1px);
}
.scale-picker-item img {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}
.scale-picker-info { flex: 1; min-width: 0; }
.scale-picker-name {
    font-family: 'Cinzel', serif;
    color: var(--gold-text-warm);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.scale-picker-item:hover .scale-picker-name {
    color: var(--gold-text-light);
}
.scale-picker-sub {
    font-family: 'Roboto Condensed', sans-serif;
    color: var(--text-secondary);
    font-size: 0.74rem;
    margin-top: 3px;
    letter-spacing: 0.01em;
}
.scale-picker-tier {
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* Override dans le picker : on neutralise les glow/animations T2-T6 (qui font
   sens dans une grille espacée mais débordent en liste compacte serrée).
   La rareté reste signalée par la couleur du label "Tier" (.scale-picker-tier). */
.scale-picker .scale-picker-item.inv-tier-1,
.scale-picker .scale-picker-item.inv-tier-2,
.scale-picker .scale-picker-item.inv-tier-3,
.scale-picker .scale-picker-item.inv-tier-4,
.scale-picker .scale-picker-item.inv-tier-5,
.scale-picker .scale-picker-item.inv-tier-6 {
    /* Reset le box-shadow par tier de sanctuary.css → garde uniquement la DA */
    box-shadow:
        inset 0 1px 0 rgba(var(--gold-rgb), 0.1),
        inset 0 -8px 12px -10px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(0, 0, 0, 0.5),
        0 2px 6px -2px rgba(0, 0, 0, 0.4);
    /* Reset la pulse animation T5/T6 */
    animation: none;
}
.scale-picker .scale-picker-item.inv-tier-1 .scale-picker-tier { color: var(--rarity-fragile); }
.scale-picker .scale-picker-item.inv-tier-2 .scale-picker-tier { color: var(--rarity-robuste); }
.scale-picker .scale-picker-item.inv-tier-3 .scale-picker-tier { color: var(--rarity-alpha); }
.scale-picker .scale-picker-item.inv-tier-4 .scale-picker-tier { color: var(--rarity-ancien); }
.scale-picker .scale-picker-item.inv-tier-5 .scale-picker-tier { color: var(--rarity-primordial); }
.scale-picker .scale-picker-item.inv-tier-6 .scale-picker-tier { color: var(--rarity-primordial_pur); }

/* XP Bar */
.xp-bar-container {
    background: var(--bg-card);
    border-radius: 6px;
    height: 20px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 1.2rem;
}
.xp-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: 5px;
    transition: width 0.5s;
}
.xp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    color: var(--white);
    text-shadow: 0 0 3px var(--black);
    font-family: 'Roboto Condensed', sans-serif;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}
.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.6rem;
    background: rgba(42, 42, 74, 0.4);
    border-radius: 6px;
    border: 1px solid var(--border);
}
.icon-stat {
    width: 28px;
    height: 28px;
   }
.stat-name {
    font-family: 'Oswald', sans-serif;
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}
.stat-value {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Stats secondaires */
.stats-grid-secondary {
    grid-template-columns: repeat(3, 1fr);
    margin: 0 auto 0.8rem;
}
.stat-secondary {
    padding: 0.4rem;
}

/* Record W/L */
.record {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}
.wins { color: var(--success); font-weight: 600; }
.losses { color: var(--error); font-weight: 600; }
.fights-left { color: var(--gray-600); font-size: 0.75rem; }

/* ============================================================
   Slot Cristal (profil dragon, a cote des competences).
   Voir MDE_Feature_Cristallisation.md.
   ============================================================ */
.profile-skills-row-with-crystal {
    align-items: flex-end;
    gap: 18px;
}
.profile-skills-group {
    display: flex;
    gap: 15px;
    align-items: center;
}
.profile-crystal-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding-left: 14px;
    
}
.profile-crystal-label {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    color: var(--gold);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.crystal-slot {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.12s;
}
.crystal-slot.crystal-slot-empty {
    background: rgba(var(--white-rgb), 0.03);
    border: 2px dashed rgba(var(--gold-rgb), 0.25);
}
.crystal-slot.crystal-slot-empty .slot-empty-label {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: rgba(var(--gold-rgb), 0.4);
}
.crystal-slot.crystal-slot-empty:hover {
    border-color: rgba(var(--gold-rgb), 0.55);
    background: rgba(var(--gold-rgb), 0.05);
}
.crystal-slot.crystal-slot-filled {
    background: linear-gradient(135deg, rgba(var(--crystal-accent-rgb), 0.12), rgba(var(--gold-rgb), 0.08));
    border: 2px solid rgba(var(--crystal-accent-rgb), 0.55);
    box-shadow: 0 0 12px rgba(var(--crystal-accent-rgb), 0.25) inset;
}
.crystal-slot.crystal-slot-filled:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 14px rgba(var(--crystal-accent-rgb), 0.4) inset, 0 6px 18px rgba(var(--black-rgb), 0.5);
}
.crystal-slot.crystal-slot-filled .slot-icon {
    width: 50px;
    height: 50px;
    filter: drop-shadow(0 0 6px rgba(var(--crystal-accent-rgb), 0.5));
}
.crystal-slot .crystal-charge-badge {
    position: absolute;
    bottom: 3px;
    right: 4px;
    font-family: 'Oswald', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: var(--white);
    background: rgba(var(--black-rgb), 0.75);
    padding: 1px 5px;
    border-radius: 6px;
    letter-spacing: 0.4px;
}

/* ============================================================
   Picker modal Cristal
   ============================================================ */
.crystal-picker-overlay { /* heritage modal-overlay */ }
.crystal-picker-box {
    max-width: 460px;
    min-width: 360px;
}
.crystal-picker-section {
    margin-bottom: 14px;
}
.crystal-picker-section-title {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(var(--gold-rgb), 0.2);
    padding-bottom: 4px;
}
.crystal-picker-card {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: rgba(var(--black-rgb), 0.35);
    border: 1px solid rgba(var(--gold-rgb), 0.18);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.12s;
    color: var(--text-main);
    font-family: inherit;
    text-align: left;
}
.crystal-picker-card:hover:not(:disabled) {
    border-color: rgba(var(--gold-rgb), 0.5);
    transform: translateX(2px);
}
.crystal-picker-icon {
    width: 44px;
    height: 44px;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 4px rgba(var(--crystal-accent-rgb), 0.4));
    flex-shrink: 0;
}
.crystal-picker-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.crystal-picker-name {
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    font-weight: 700;
}
.crystal-picker-charge {
    font-family: 'Oswald', sans-serif;
    font-size: 0.8rem;
    color: var(--gold);
}
.crystal-picker-tag {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 0.72rem;
    color: var(--text-dim);
    font-style: italic;
}
.crystal-picker-tag.is-max {
    color: var(--rarity-primordial);
    font-weight: 600;
    font-style: normal;
}
.crystal-picker-tag.is-equipped {
    color: var(--gold);
    font-weight: 500;
    font-style: normal;
}
.crystal-picker-empty {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 20px 10px;
}

/* =====================================================================
   RESPONSIVE - Panel Profil
   ---------------------------------------------------------------------
   Le desktop reste intact (tailles fixes existantes : canvas 375px,
   paddings 2.1rem/3.5rem, font-sizes en rem). On adapte uniquement
   par breakpoints en reduisant les valeurs des elements problematiques.
   ===================================================================== */

/* === 1280px : laptop / petit desktop (Full HD au-dessus pas touche) === */
@media (max-width: 1280px) {
    .profile-showcase { gap: 1rem; padding: 0.8rem 1rem; }
    .dragon-card-inner { padding: 1.4rem 2.4rem 1.2rem; }
    #dragon-preview { width: 320px; height: 320px; }
    .dragon-name { font-size: 1.9rem; }
    .profile-info-panel { padding: 1.6rem; }
    .pstat-row-icon { width: 38px; height: 38px; }
    .pstat-track { height: 20px; }
}

/* === 1100px : stack vertical (carte dragon en haut, panel stats en bas) + scroll === */
@media (max-width: 1100px) {
    /* Le panel-profile reste a hauteur viewport (comme en desktop) mais scroll
       en interne. L'arena perd sa contrainte d'occuper toute la hauteur :
       elle prend la taille naturelle de son contenu, qui peut deborder. */
    .panel-profile.active {
        overflow-y: auto;
    }
    .panel-profile .profile-arena {
        height: auto;
        flex: none;
        min-height: 100%;
    }
    /* Les bg/overlay restent en absolute par rapport a l'arena. Pour que le
       fond couvre meme apres scroll, on les fixe a 100% de la hauteur reelle. */
    .profile-arena-bg,
    .profile-arena-overlay {
        height: 100%;
    }
    .profile-showcase {
        flex-direction: column;
        align-items: stretch;
        flex-wrap: wrap;
    }
    .profile-dragon-card,
    .profile-info-panel {
        width: 100%;
        max-width: 640px;
        margin: 0 auto;
    }
    /* Carte dragon EN PREMIER (deja l'ordre HTML, mais on l'ancre explicitement) */
    .profile-dragon-card { order: 1; }
    .profile-info-panel  { order: 2; }
    .dragon-card-inner {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 1.2rem;
    }
    .dragon-visual { flex: 0 0 auto; }
    .dragon-identity, .dragon-card-xp { flex: 1 1 auto; min-width: 200px; }
}

/* === 900px : reduction supplementaire des paddings / canvas === */
@media (max-width: 900px) {
    #dragon-preview { width: 280px; height: 280px; }
    .dragon-card-inner { padding: 1.2rem 1.6rem; }
    .profile-info-panel { padding: 1.2rem; }
    .dragon-name { font-size: 1.7rem; }
    .pstat-row-icon { width: 36px; height: 36px; }
    .pstat-icon-badge img { width: 32px; height: 32px; }
    .profile-guardian-bar { padding: 10px 18px; max-width: 480px; }
}

/* === 720px : tablette portrait === */
@media (max-width: 720px) {
    .panel-profile { padding: 0.4rem; }
    .profile-arena { gap: 0.6rem; }
    .dragon-card-inner {
        flex-direction: column;
        padding: 1rem;
    }
    #dragon-preview { width: 240px; height: 240px; }
    .dragon-name { font-size: 1.5rem; }
    .dragon-species-name, .dragon-species { font-size: 1rem; }
    .dragon-lore { font-size: 0.78rem; max-width: 260px; }
    .profile-info-panel { padding: 1rem; }
    .pstat-row-icon { width: 32px; height: 32px; }
    .pstat-icon-badge img { width: 28px; height: 28px; }
    .pstat-name { font-size: 0.95rem; min-width: 60px; }
    .pstat-track { height: 18px; }
    .pstat-icons-grid { gap: 6px; }
    .profile-guardian-bar { gap: 6px; padding: 8px 12px; max-width: 96vw; }
    .profile-guardian-bar-title { font-size: 0.78rem; }
    .equip-slot-picker { width: 92vw; max-width: 320px; }
}

/* === 480px : mobile === */
@media (max-width: 480px) {
    #dragon-preview { width: 200px; height: 200px; }
    .dragon-name { font-size: 1.3rem; }
    .pstat-name { font-size: 0.85rem; min-width: 48px; }
    .pstat-row { gap: 8px; }
    .pstat-row-icon { width: 28px; height: 28px; }
    .pstat-track { height: 16px; }
    .profile-bg-switch { font-size: 0.7rem; padding: 0.3rem 0.6rem; }
}

/* === Hauteur courte (laptops 13" 1366x768 paysage) ===
   Sans ca le canvas + identite + xp + guardian bar depassent 768px et la
   page scroll inutilement. Compression verticale dediee. */
@media (max-height: 800px) and (min-width: 1100px) {
    .profile-showcase { padding-top: 0.4rem; padding-bottom: 0.4rem; }
    .dragon-card-inner { padding: 1.2rem 2rem 1rem; gap: 0.5rem; }
    #dragon-preview { width: 280px; height: 280px; }
    .dragon-name { font-size: 1.7rem; margin-bottom: 0.15rem; }
    .dragon-lore { font-size: 0.78rem; line-height: 1.3; max-width: 260px; }
    .profile-info-panel { padding: 1.2rem 1.5rem; }
    .pstat-bars { gap: 6px; }
    .pstat-row-icon { width: 36px; height: 36px; }
    .pstat-track { height: 18px; }
    .profile-guardian-bar { padding: 8px 18px 10px; }
}

/* =====================================================================
   TELEPHONE PAYSAGE - format impose par .rotate-prompt
   ---------------------------------------------------------------------
   Cible : ~640-900px de large, < 500px de haut (iPhone/Android paysage).
   On garde les 2 panneaux cote a cote (largeur OK), mais on compresse
   tres fort en hauteur : canvas dragon mini, paddings minimum, font
   reduit, scroll interne au panel-profile pour absorber le debordement.
   Override les regles `< 720px` qui empilaient en colonne (mauvais pour
   paysage etroit en hauteur).
   ===================================================================== */
@media (max-width: 1000px) and (orientation: landscape) and (max-height: 500px) {
    /* Laisse les 2 panneaux cote a cote, surmonte l'override < 1100px qui
       les avait passes en colonne. */
    .profile-showcase {
        flex-direction: row !important;
        flex-wrap: nowrap;
        gap: 0.6rem !important;
        padding: 0.4rem 0.6rem !important;
        align-items: stretch !important;
    }
    .profile-dragon-card,
    .profile-info-panel {
        max-width: none !important;
        margin: 0 !important;
        flex: 1 1 50% !important;
        min-width: 0;
    }
    .dragon-card-inner {
        flex-direction: column !important;
        padding: 0.6rem 0.8rem !important;
        gap: 0.4rem !important;
    }
    /* Canvas dragon : assez petit pour rentrer dans la moitie gauche, et
       assez grand pour rester lisible. */
    #dragon-preview {
        width: 150px !important;
        height: 150px !important;
    }
    .dragon-visual-glow {
        top: -14px; left: -14px; right: -14px; bottom: -14px;
    }
    .dragon-name {
        font-size: 1.1rem !important;
        margin: 0 0 0.1rem !important;
    }
    .dragon-species,
    .dragon-species-name {
        font-size: 0.75rem !important;
    }
    .dragon-lore {
        font-size: 0.65rem !important;
        line-height: 1.2 !important;
        margin: 0.1rem 0 0.2rem !important;
        max-width: 220px !important;
    }
    .dragon-meta {
        font-size: 0.7rem !important;
        gap: 0.3rem !important;
    }
    .dragon-card-xp {
        margin-top: 0.2rem !important;
    }
    .dragon-card-xp-label {
        font-size: 0.6rem !important;
    }
    .dragon-card-xp-bar {
        height: 12px !important;
    }
    .pvp-card-power,
    .dragon-rarity-corner {
        font-size: 0.6rem !important;
        padding: 2px 6px !important;
    }

    .profile-info-panel {
        padding: 0.7rem 0.9rem !important;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    .pstat-bars {
        gap: 4px !important;
    }
    .pstat-row {
        gap: 6px !important;
    }
    .pstat-row-icon {
        width: 22px !important;
        height: 22px !important;
    }
    .pstat-name {
        font-size: 0.7rem !important;
        min-width: 42px !important;
    }
    .pstat-track {
        height: 12px !important;
    }
    .pstat-icons-grid {
        gap: 4px !important;
    }
    .pstat-icon-badge img {
        width: 22px !important;
        height: 22px !important;
    }

    /* Guardian bar compactee en bas */
    .profile-guardian-bar {
        padding: 4px 10px !important;
        gap: 4px !important;
        max-width: 96vw !important;
    }
    .profile-guardian-bar-title {
        font-size: 0.7rem !important;
    }

    /* Le panel-profile.active reste en hauteur viewport mais scroll interne
       seulement si besoin (la compression devrait suffire le plus souvent). */
    .panel-profile.active {
        overflow-y: auto;
    }
    .panel-profile .profile-arena {
        height: auto;
        min-height: calc(100vh - var(--header-h));
        min-height: calc(100dvh - var(--header-h));
    }
}

/* =====================================================================
   Mobile paysage (hauteur tres courte 320-500px) - compaction extreme
   ---------------------------------------------------------------------
   Override les regles 720-1100px qui ne sont pas adaptees a la hauteur
   mobile paysage. Force un layout 2-colonnes compact (dragon a gauche,
   stats a droite) avec scroll vertical autorise dans le panel.
   ===================================================================== */
@media (max-width: 1000px) and (orientation: landscape) and (max-height: 500px) {
    /* Scroll autorise dans le panel pour ne pas perdre de contenu */
    .panel-profile.active {
        overflow-y: auto;
        height: 100vh;
        height: 100dvh;
    }
    .panel-profile { padding: 0.3rem; margin: 0; }
    .panel-profile .profile-arena {
        gap: 0.4rem;
        padding: 0.3rem 0.5rem;
        height: auto;
        min-height: 100%;
    }

    /* Showcase : forcer un layout 2-colonnes (dragon | stats) au lieu du
       column stack du breakpoint 1100px */
    .profile-showcase {
        flex-direction: row !important;
        align-items: stretch;
        flex-wrap: nowrap;
        gap: 0.5rem;
        padding: 0.3rem 0.4rem;
    }
    .profile-dragon-card,
    .profile-info-panel {
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
    }
    .profile-dragon-card { flex: 0 0 38%; }
    .profile-info-panel  { flex: 1 1 auto; padding: 0.5rem 0.7rem; }

    /* Carte dragon compacte (.dragon-card-inner doit fill son parent
       .profile-dragon-card pour eviter le decalage de taille) */
    .profile-dragon-card { display: flex; }
    .dragon-card-inner {
        flex-direction: column !important;
        gap: 0.3rem;
        padding: 0.5rem !important;
        width: 100%;
        height: 100%;
        box-sizing: border-box;
    }
    #dragon-preview { width: 130px !important; height: 130px !important; }
    .dragon-name { font-size: 1rem !important; }
    .dragon-species,
    .dragon-species-name { font-size: 0.7rem !important; }
    .dragon-lore { display: none; }
    .dragon-card-xp { padding: 0; }
    .dragon-identity { min-width: 0; text-align: center; }

    /* Stats compactes (icone + libelle + barre) */
    .pstat-row { gap: 6px; }
    .pstat-row-icon { width: 20px !important; height: 20px !important; }
    .pstat-icon-badge img { width: 16px !important; height: 16px !important; }
    .pstat-name { font-size: 0.7rem !important; min-width: 44px !important; }
    .pstat-track { height: 11px !important; }
    .pstat-value { font-size: 0.7rem; }
    .pstat-icons-grid { gap: 4px; }

    /* Bandeau Equipement Gardien (en bas du showcase) compact */
    .profile-guardian-bar {
        padding: 4px 10px !important;
        max-width: 90vw;
        gap: 4px;
    }
    .profile-guardian-bar-title { font-size: 0.65rem !important; }
}
