/* ===================================================
   ROGUEH24 GAMIFICATION CSS - NÉO-BRUTALISME
   =================================================== */

/* ===================================================
   0. AVATARS - BORDURE NOIRE EN CSS
   =================================================== */
/* Bordure noire + border-radius pour les avatars de rang */
img.rh24-rank-avatar {
    border: 3px solid #000 !important;
    border-radius: 50% !important;
    box-shadow: 2px 2px 0 0 rgba(0, 0, 0, 0.5) !important;
}

/* ===================================================
   1. CONTENEUR PRINCIPAL RÉCOMPENSES
   =================================================== */
.rh24-rewards-container {
    border-radius: 16px;
    padding: 30px;
    margin: 0px 0;
}

[data-theme="dark"] .rh24-rewards-container {

}

/* ===================================================
   2. HEADER RÉCOMPENSES
   =================================================== */
.rh24-rewards-header {
    margin-bottom: 40px;
}

.rh24-current-rank-card {
    background: #fff;
    border: 2px solid #000;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--rh24-shadow-lg-k, 4px 4px 0 0 #000);
    display: flex;
    gap: 25px;
    align-items: center;
}

[data-theme="dark"] .rh24-current-rank-card {
    background-color: #2a2a2a; color: #f0f0f0;
}

.rank-badge-large {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #000;
    box-shadow: var(--rh24-shadow-lg-k, 4px 4px 0 0 #000);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
}

.rank-badge-large .rank-name {
    font-size: 20px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rank-badge-large .rank-level {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 4px;
}

.rank-xp-info {
    flex: 1;
}

.xp-label {
    font-size: 16px;
    margin-bottom: 12px;
    opacity: 0.8;
}

.xp-progress-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border: 2px solid #000;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    margin-bottom: 10px;
}

[data-theme="dark"] .xp-progress-bar {
    background: #333;
}

.xp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f39c12 0%, #e67e22 100%);
    border-right: 2px solid #000;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

/* Effet hachures sur la barre XP */
.xp-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 6px,
        rgba(0,0,0,0.1) 6px,
        rgba(0,0,0,0.1) 12px
    );
}

.xp-next-rank {
    font-size: 13px;
    opacity: 0.7;
}

.xp-max-level {
    font-size: 18px;
    font-weight: 700;
    color: #f39c12;
}

/* ===================================================
   3. LISTE DES RÉCOMPENSES
   =================================================== */
.rh24-rewards-list {
    display: grid;
    gap: 20px;
}

.rh24-reward-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    transition: all 0.3s ease;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .rh24-reward-card {
    background-color: #2a2a2a; color: #f0f0f0;
}

.rh24-reward-card.current {
    border-color: #f39c12;
    border-width: 3px;
    box-shadow: 6px 6px 0 0 #f39c12;
}

.rh24-reward-card.locked {
    opacity: 0.5;
    filter: blur(1px);
}

.rh24-reward-card.locked:hover {
    opacity: 0.7;
}

.rh24-reward-card.unlocked:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 0 #000;
}

/* Badge du rang dans la carte */
.reward-rank-badge {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid #000;
    box-shadow: var(--rh24-shadow-md-k, 3px 3px 0 0 #000);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.reward-rank-badge .rank-name {
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
}

.reward-rank-badge .rank-level {
    font-size: 10px;
    opacity: 0.9;
    margin-top: 2px;
}

.reward-info {
    flex: 1;
}

.reward-type {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.reward-xp {
    font-size: 13px;
    opacity: 0.7;
    margin-bottom: 15px;
}

/* ===================================================
   4. BOÎTES DE CLÉS
   =================================================== */
.reward-key-container {
    margin-top: 15px;
}

.reward-key-box {
    background: rgba(0,0,0,0.03);
    border: 2px solid #000;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    gap: 15px;
    align-items: center;
}

[data-theme="dark"] .reward-key-box {
    background: rgba(255,255,255,0.05);
}

.reward-key-box.available {
    background: rgba(46, 204, 113, 0.1);
    border-color: #2ecc71;
}

.reward-key-box.claimed {
    background: rgba(52, 152, 219, 0.1);
    border-color: #3498db;
}

.reward-key-box.pending {
    background: rgba(243, 156, 18, 0.1);
    border-color: #f39c12;
}

.key-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.key-text {
    flex: 1;
}

.key-text strong {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

.key-text code {
    background: rgba(0,0,0,0.1);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    display: inline-block;
    border: 1px solid rgba(0,0,0,0.2);
}

[data-theme="dark"] .key-text code {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}

/* Le lien d activation Steam, sous la clé. Couleur héritée de la boîte :
   pas de fond posé, donc pas de couleur de texte imposée. */
.key-text .rh24-activer-steam {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 700;
    color: inherit;
    text-decoration: underline;
}

.rh24-key-blur {
    filter: blur(4px);
    transition: filter 0.3s ease;
}

.btn-reveal-key {
    background: #2ecc71 !important;
    color: #fff !important;
    border: 2px solid #000 !important;
    box-shadow: var(--rh24-shadow-md-k, 3px 3px 0 0 #000) !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-reveal-key:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 0 #000 !important;
}

/* ===================================================
   5. BADGES SUR AVATARS (Commentaires)
   =================================================== */
.rh24-avatar-wrapper {
    position: relative;
    display: inline-block;
}

.rh24-rank-badge-small {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: #3498db;
    color: #fff;
    border: 2px solid #000;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 11px;
    box-shadow: var(--rh24-shadow-sm-k, 2px 2px 0 0 #000);
    z-index: 10;
}

/* ===================================================
   6. BARRE XP DANS LES COMMENTAIRES
   =================================================== */
.rh24-comment-xp-bar {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

[data-theme="dark"] .rh24-comment-xp-bar {
    border-top-color: rgba(255,255,255,0.1);
}

.rh24-rank-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rank-badge-mini {
    background: #3498db;
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 11px;
    border: 2px solid #000;
    box-shadow: var(--rh24-shadow-sm-k, 2px 2px 0 0 #000);
}

.rh24-xp-progress-bar-mini {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border: 2px solid #000;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

[data-theme="dark"] .rh24-xp-progress-bar-mini {
    background: #333;
}

.rh24-xp-progress-bar-mini .xp-fill {
    height: 100%;
    background: #3498db;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* ===================================================
   7. RESPONSIVE
   =================================================== */
@media (max-width: 768px) {
    .rh24-rewards-container {
        padding: 0px;
    }
    
    .rh24-current-rank-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .rank-badge-large {
        width: 100px;
        height: 100px;
    }
    
    .rank-badge-large .rank-name {
        font-size: 16px;
    }
    
    .rh24-reward-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .reward-rank-badge {
        width: 70px;
        height: 70px;
    }
    
    .reward-key-box {
        flex-direction: column;
        text-align: center;
    }
    
    .btn-reveal-key {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .rh24-rewards-header h2 {
        font-size: 22px;
    }
    
    .rank-badge-large {
        width: 80px;
        height: 80px;
    }
    
    .rank-badge-large .rank-name {
        font-size: 14px;
    }
    
    .reward-type {
        font-size: 16px;
    }
}

/* ===================================================
   8. ANIMATIONS
   =================================================== */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 6px 6px 0 0 #f39c12;
    }
    50% {
        box-shadow: 6px 6px 0 0 #f39c12, 0 0 20px rgba(243, 156, 18, 0.5);
    }
}

.rh24-reward-card.current {
    animation: pulse-glow 2s infinite;
}

/* ===================================================
   9. BADGE INLINE (pour widgets)
   =================================================== */
.rh24-rank-badge-inline {
    display: inline-block;
    background: #3498db;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 10px;
    margin-left: 6px;
    border: 2px solid #000;
    box-shadow: var(--rh24-shadow-sm-k, 2px 2px 0 0 #000);
    vertical-align: middle;
}

/* ====================================
   RESPONSIVE ADMIN (MENU WORDPRESS)
   ==================================== */

/* Menu admin sur mobile/tablette */
@media screen and (max-width: 782px) {
    /* Panneau de synchronisation */
    .rh24-sync-panel {
        padding: 15px !important;
    }
    
    .rh24-sync-panel h2 {
        font-size: 18px !important;
    }
    
    .rh24-sync-panel p {
        font-size: 13px !important;
    }
    
    /* Boutons de synchronisation en colonne */
    .rh24-sync-panel > div[style*="display:flex"] {
        flex-direction: column !important;
    }
    
    .rh24-sync-panel button {
        width: 100% !important;
        min-width: auto !important;
        margin-bottom: 10px !important;
    }
    
    /* Tables responsive */
    .rh24-admin-rewards-table {
        font-size: 13px !important;
    }
    
    .rh24-admin-rewards-table th,
    .rh24-admin-rewards-table td {
        padding: 8px 6px !important;
    }
    
    /* Dashboard stats */
    .rh24-admin-dashboard {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    /* Formulaire de configuration */
    .form-table th,
    .form-table td {
        display: block !important;
        width: 100% !important;
        padding: 10px 0 !important;
    }
    
    .form-table th {
        padding-bottom: 5px !important;
    }
    
    input[type="text"],
    input[type="number"],
    .color-picker {
        width: 100% !important;
    }
}

/* Très petits écrans */
@media screen and (max-width: 600px) {
    .wrap h1 {
        font-size: 20px !important;
    }
    
    .rh24-sync-panel h2 {
        font-size: 16px !important;
    }
    
    /* Cacher certaines colonnes non essentielles en très petit écran */
    .rh24-admin-rewards-table .column-type {
        display: none !important;
    }
}

/* ============================================================================
   PAGE LOOT — ANIMATIONS ET SURVOLS (v6.4.23)
   ============================================================================
   Meme grammaire que la page Classement, et surtout MEME REGLE :

     ce qui porte une information ne depend jamais d un mouvement.

   Apprise a la dure (v6.4.21) : une apparition en `opacity: 0 -> 1` avec
   `both` laisse la page ENTIEREMENT INVISIBLE quand l animation ne demarre
   pas -- ce qui arrive dans un onglet d arriere-plan, chez un vrai lecteur.
   Ici, aucun keyframe ne touche a l opacite : les cartes entrent par un
   `transform`, et sans animation elles sont simplement a leur place.
   ========================================================================== */

/* ---- Entree en cascade : transform seul, `backwards` jamais `both` ------- */
.rh24-reward-card {
    animation: rh24-loot-entre .45s ease backwards;
}
.rh24-rewards-list .rh24-reward-card:nth-child(1)  { animation-delay: .00s; }
.rh24-rewards-list .rh24-reward-card:nth-child(2)  { animation-delay: .05s; }
.rh24-rewards-list .rh24-reward-card:nth-child(3)  { animation-delay: .10s; }
.rh24-rewards-list .rh24-reward-card:nth-child(4)  { animation-delay: .15s; }
.rh24-rewards-list .rh24-reward-card:nth-child(5)  { animation-delay: .20s; }
.rh24-rewards-list .rh24-reward-card:nth-child(6)  { animation-delay: .25s; }
.rh24-rewards-list .rh24-reward-card:nth-child(7)  { animation-delay: .30s; }
.rh24-rewards-list .rh24-reward-card:nth-child(8)  { animation-delay: .35s; }
.rh24-rewards-list .rh24-reward-card:nth-child(9)  { animation-delay: .40s; }
.rh24-rewards-list .rh24-reward-card:nth-child(n+10) { animation-delay: .45s; }

/* ---- Le badge de rang reagit au survol de SA carte ----------------------- */
.reward-rank-badge { transition: transform .25s ease; }
.rh24-reward-card.unlocked:hover .reward-rank-badge { transform: rotate(-6deg) scale(1.08); }

/* ---- La carte du rang COURANT respire ------------------------------------
   Decoratif : une lueur ambree autour d une carte qui porte deja sa bordure
   et son ombre. Si l animation ne part pas, la carte reste parfaitement
   identifiable. */
.rh24-reward-card.current {
    animation: rh24-loot-pulse 2.6s ease-in-out infinite;
}

/* ---- Les cartes verrouillees se devoilent un peu au survol --------------- */
.rh24-reward-card.locked { transition: opacity .25s ease, filter .25s ease; }
.rh24-reward-card.locked:hover { opacity: .85; filter: blur(0); }

/* ---- Reflet sur la barre d XP -------------------------------------------
   Sur un pseudo-element : la LARGEUR de `.xp-progress-fill` porte
   l information et reste posee par le serveur. Le reflet peut ne jamais
   partir, il n emporte rien. `::after` etant deja pris par les rayures, on
   pose le reflet sur `::before`. */
.xp-progress-fill::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, .55) 50%,
        transparent 100%);
    transform: translateX(-100%);
    animation: rh24-loot-reflet 2.8s ease-in-out infinite;
    z-index: 1;
}

/* ---- Le bouton « Reveler » : meme enfonce que les autres boutons --------- */
.btn-reveal-key {
    transition: transform .15s ease, box-shadow .15s ease;
}
.btn-reveal-key:hover {
    transform: translate(-1px, -1px);
    box-shadow: var(--rh24-shadow-md, 3px 3px 0 0 #333);
}
.btn-reveal-key:active {
    transform: translate(1px, 1px);
    box-shadow: var(--rh24-shadow-sm, 2px 2px 0 0 #333);
}

/* ---- Une cle disponible attire l oeil ------------------------------------
   Le fond de la boite change doucement. Le texte, lui, ne bouge pas. */
.reward-key-box.available {
    animation: rh24-loot-dispo 3s ease-in-out infinite;
}

@keyframes rh24-loot-entre  { from { transform: translateY(12px); } }
@keyframes rh24-loot-pulse  {
    0%, 100% { box-shadow: 6px 6px 0 0 #f39c12, 0 0 0 0 rgba(243, 156, 18, .45); }
    50%      { box-shadow: 6px 6px 0 0 #f39c12, 0 0 0 10px rgba(243, 156, 18, 0); }
}
@keyframes rh24-loot-reflet { 0% { transform: translateX(-100%); } 55%, 100% { transform: translateX(100%); } }
@keyframes rh24-loot-dispo  {
    0%, 100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, .35); }
    50%      { box-shadow: 0 0 0 8px rgba(76, 175, 80, 0); }
}

/* « Moins de mouvement » ne veut pas dire « plus de retour » : on retire les
   trajets et les boucles, on garde les changements de couleur. */
@media (prefers-reduced-motion: reduce) {
    .rh24-reward-card,
    .rh24-reward-card.current,
    .reward-key-box.available,
    .xp-progress-fill::before { animation: none; }
    .xp-progress-fill::before { display: none; }
    .rh24-reward-card.unlocked:hover { transform: none; }
    .rh24-reward-card.unlocked:hover .reward-rank-badge { transform: none; }
    .btn-reveal-key:hover, .btn-reveal-key:active { transform: none; }
}

.rh24-icon { display: inline-block !important; vertical-align: -0.15em !important; flex-shrink: 0 !important; width: 1.1em !important; height: 1.1em !important; color: currentColor !important; stroke: currentColor !important; }

