.afkRewardPanel {
    position: fixed;
    inset: 0;
    z-index: 8000;
    display: grid;
    place-items: center;
    padding: 14px;
    pointer-events: none;
    visibility: hidden;
}
.afkRewardPanel.is-open { pointer-events: auto; visibility: visible; }
.afkRewardBackdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(0, 7, 18, .78);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity .18s ease;
}
.afkRewardPanel.is-open .afkRewardBackdrop { opacity: 1; }
.afkRewardDialog {
    position: relative;
    width: min(100%, 430px);
    max-height: min(92vh, 760px);
    overflow: hidden;
    border: 1px solid rgba(103, 167, 216, .66);
    border-radius: 18px;
    background:
        radial-gradient(circle at 50% -18%, rgba(77, 125, 204, .24), transparent 42%),
        linear-gradient(180deg, rgba(24, 51, 85, .995), rgba(8, 23, 42, .995));
    color: #fff;
    box-shadow: 0 24px 70px rgba(0,0,0,.7), inset 0 1px rgba(255,255,255,.1);
    transform: translateY(18px) scale(.98);
    opacity: 0;
    transition: transform .18s ease, opacity .18s ease;
}
.afkRewardPanel.is-open .afkRewardDialog { transform: none; opacity: 1; }
.afkRewardClose {
    position: absolute;
    z-index: 2;
    top: 13px;
    right: 13px;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(196, 221, 244, .32);
    border-radius: 11px;
    background: rgba(63, 105, 145, .28);
    color: #e9f4ff;
    font-size: 16px;
}
.afkRewardBody {
    max-height: min(92vh, 760px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 22px 20px 18px;
    scrollbar-width: none;
}
.afkRewardBody::-webkit-scrollbar { display: none; width: 0; height: 0; }
.afkRewardScrollRail {
    position: absolute;
    z-index: 3;
    top: 58px;
    right: 5px;
    bottom: 9px;
    width: 6px;
    border-radius: 999px;
    background: rgba(4, 20, 36, .55);
    box-shadow: inset 0 0 0 1px rgba(98, 188, 224, .09);
    touch-action: none;
    cursor: pointer;
}
.afkRewardScrollRail[hidden] { display: none; }
.afkRewardScrollThumb {
    display: block;
    width: 100%;
    min-height: 34px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(100, 213, 231, .88), rgba(36, 126, 166, .92));
    box-shadow: 0 0 7px rgba(75, 183, 219, .24);
    will-change: transform;
}
.afkRewardScrollRail:hover .afkRewardScrollThumb {
    background: linear-gradient(180deg, rgba(130, 226, 242, .96), rgba(49, 151, 192, .98));
}
.afkRewardBrand {
    display: block;
    text-align: center;
    color: #86ace1;
    font: 800 9px/1 "Poppins", sans-serif;
    letter-spacing: 1.7px;
}
.afkRewardMoon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin: 13px auto 8px;
    border: 1px solid rgba(126, 174, 231, .46);
    border-radius: 50%;
    background: rgba(71, 111, 168, .13);
    color: #bdd5ff;
    font-size: 24px;
    box-shadow: inset 0 0 18px rgba(120, 169, 233, .08);
}
.afkRewardBody h2 {
    margin: 0;
    text-align: center;
    color: #fff;
    font: 900 25px/1.05 "Poppins", sans-serif;
    letter-spacing: .2px;
}
.afkRewardIntro {
    max-width: 320px;
    margin: 8px auto 15px;
    text-align: center;
    color: #aebdd0;
    font: 500 11px/1.45 "Poppins", sans-serif;
}
.afkRewardMain {
    margin: 0 0 13px;
    padding: 14px 12px 13px;
    border: 1px solid rgba(74, 210, 147, .34);
    border-radius: 13px;
    background: linear-gradient(180deg, rgba(11, 65, 58, .38), rgba(9, 50, 48, .28));
    text-align: center;
}
.afkRewardMain > span {
    display: block;
    color: #9cb4c6;
    font: 800 8px/1 "Poppins", sans-serif;
    letter-spacing: .4px;
}
.afkRewardMain > div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}
.afkRewardMain img { width: 25px; height: 25px; object-fit: contain; }
.afkRewardMain strong {
    color: #62f5a2;
    font: 900 28px/1 "Poppins", sans-serif;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 12px rgba(50, 240, 145, .2);
}
.afkRewardSummary {
    overflow: hidden;
    border: 1px solid rgba(153, 184, 218, .16);
    border-radius: 12px;
    background: rgba(4, 17, 34, .34);
}
.afkRewardSummaryRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 39px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(154, 185, 218, .11);
}
.afkRewardSummaryRow:last-child { border-bottom: 0; }
.afkRewardSummaryRow span { color: #9caabd; font: 500 10px/1.2 "Poppins", sans-serif; }
.afkRewardSummaryRow strong {
    color: #f4f7fb;
    font: 800 11px/1.2 "Poppins", sans-serif;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.afkRewardLootSection {
    margin-top: 13px;
    padding: 11px;
    border: 1px solid rgba(135, 180, 217, .18);
    border-radius: 12px;
    background: rgba(4, 17, 34, .26);
}
.afkRewardLootHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
}
.afkRewardLootHeader strong { color: #dcecff; font: 800 9px/1 "Poppins", sans-serif; letter-spacing: .45px; }
.afkRewardLootHeader span { color: #7fa3bf; font: 700 8px/1 "Poppins", sans-serif; }
.afkRewardLoot {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 7px;
    overflow: visible;
    touch-action: auto;
}
.afkRewardLootItem {
    position: relative;
    flex: 0 0 65px;
    min-width: 65px;
    min-height: 72px;
    padding: 6px 4px 5px;
    border: 1px solid rgba(148, 182, 207, .23);
    border-radius: 9px;
    background: linear-gradient(180deg, rgba(27, 66, 91, .76), rgba(7, 29, 46, .84));
    text-align: center;
    box-shadow: inset 0 1px rgba(255,255,255,.035);
}
.afkRewardLootItem--rare { border-color: rgba(75, 159, 255, .45); }
.afkRewardLootItem--epic { border-color: rgba(174, 103, 255, .55); box-shadow: inset 0 0 16px rgba(127, 73, 218, .08); }
.afkRewardLootItem--legendary { border-color: rgba(255, 191, 75, .62); box-shadow: inset 0 0 16px rgba(229, 150, 31, .1); }
.afkRewardLootItem--supreme { border-color: rgba(255, 119, 207, .68); box-shadow: inset 0 0 18px rgba(227, 72, 185, .11); }
/* Les autres familles de loot conservent leur convention historique. Pour les
   Glyphes uniquement : Commun blanc, Peu commun bleu, Rare vert, Épique jaune,
   Légendaire violet. */
.afkRewardLootItem--kind-glyph.afkRewardLootItem--common {
    border-color: rgba(235, 238, 245, .72);
    box-shadow: inset 0 0 14px rgba(235, 238, 245, .08);
}
.afkRewardLootItem--kind-glyph.afkRewardLootItem--uncommon {
    border-color: rgba(84, 151, 255, .72);
    box-shadow: inset 0 0 14px rgba(84, 151, 255, .10);
}
.afkRewardLootItem--kind-glyph.afkRewardLootItem--rare {
    border-color: rgba(88, 222, 120, .72);
    box-shadow: inset 0 0 14px rgba(88, 222, 120, .10);
}
.afkRewardLootItem--kind-glyph.afkRewardLootItem--epic {
    border-color: rgba(255, 211, 89, .76);
    box-shadow: inset 0 0 16px rgba(255, 211, 89, .11);
}
.afkRewardLootItem--kind-glyph.afkRewardLootItem--legendary {
    border-color: rgba(191, 116, 255, .78);
    box-shadow: inset 0 0 16px rgba(191, 116, 255, .12);
}
.afkRewardLootAmount {
    position: absolute;
    top: 3px;
    right: 4px;
    z-index: 1;
    color: #fff;
    font: 900 9px/1 "Poppins", sans-serif;
    text-shadow: 0 1px 3px #000;
}
.afkRewardLootVisual {
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    margin: 4px auto 1px;
    color: #cce9ff;
    font-size: 24px;
}
.afkRewardLootVisual img { max-width: 38px; max-height: 38px; object-fit: contain; }
.afkRewardLootLabel {
    display: block;
    overflow: hidden;
    color: #b8cada;
    font: 600 7px/1.15 "Poppins", sans-serif;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.afkRewardLootEmpty {
    margin: 3px 0 1px;
    color: #7f99ad;
    text-align: center;
    font: 500 9px/1.35 "Poppins", sans-serif;
}
.afkRewardBuffNote,
.afkRewardCapNote {
    margin: 10px 4px 0;
    color: #88a3b8;
    font: 500 8px/1.4 "Poppins", sans-serif;
    text-align: center;
}
.afkRewardBuffNote i { margin-right: 4px; color: #75bfe7; }
.afkRewardCapNote { color: #e6c879; }
.afkRewardContinue {
    width: 100%;
    min-height: 43px;
    margin: 13px 0 0;
    border: 1px solid rgba(255, 211, 106, .56);
    border-radius: 11px;
    background: linear-gradient(180deg, #c88416, #9d600b);
    color: #fff;
    font: 900 12px/1 "Poppins", sans-serif;
    box-shadow: inset 0 1px rgba(255,255,255,.18);
}
@media (max-width: 480px) {
    .afkRewardPanel { padding: 9px; }
    .afkRewardBody { padding: 18px 14px 14px; }
    .afkRewardDialog { width: min(100%, 410px); }
    .afkRewardScrollRail { right: 3px; width: 5px; }
    .afkRewardLootItem { flex-basis: 60px; min-width: 60px; }
}
@media (prefers-reduced-motion: reduce) {
    .afkRewardBackdrop, .afkRewardDialog { transition: none; }
}

/* Runes auto-détruites : conserver l'icône glyphe + badge Cristaux runiques. */
.afkRewardLootItem--kind-glyph_auto_destroy.afkRewardLootItem--common {
    border-color: rgba(235, 238, 245, .72);
    box-shadow: inset 0 0 14px rgba(235, 238, 245, .08);
}
.afkRewardLootItem--kind-glyph_auto_destroy.afkRewardLootItem--uncommon {
    border-color: rgba(84, 151, 255, .72);
    box-shadow: inset 0 0 14px rgba(84, 151, 255, .10);
}
.afkRewardLootItem--kind-glyph_auto_destroy.afkRewardLootItem--rare {
    border-color: rgba(88, 222, 120, .72);
    box-shadow: inset 0 0 14px rgba(88, 222, 120, .10);
}
.afkRewardLootItem--kind-glyph_auto_destroy.afkRewardLootItem--epic {
    border-color: rgba(255, 211, 89, .76);
    box-shadow: inset 0 0 16px rgba(255, 211, 89, .11);
}
.afkRewardLootItem--kind-glyph_auto_destroy.afkRewardLootItem--legendary,
.afkRewardLootItem--kind-glyph_auto_destroy.afkRewardLootItem--supreme {
    border-color: rgba(191, 116, 255, .78);
    box-shadow: inset 0 0 16px rgba(191, 116, 255, .12);
}
.afkRewardLootVisual--glyph {
    position: relative;
    overflow: hidden;
    --glyph-visual-size: 35px;
    --glyph-visual-shift-y: -52%;
}
.afkRewardLootVisual--glyph.afkRewardLootVisual--glyph-square {
    --glyph-visual-size: 35px;
    --glyph-visual-shift-y: -54%;
}
.afkRewardLootVisual--glyph.afkRewardLootVisual--glyph-hex {
    --glyph-visual-size: 35px;
    --glyph-visual-shift-y: -52%;
}
.afkRewardLootVisual--glyph.afkRewardLootVisual--glyph-leaf {
    --glyph-visual-size: 34px;
    --glyph-visual-shift-y: -50%;
}
.afkRewardLootVisual--glyph .afkRewardGlyphBase,
.afkRewardLootVisual--glyph .afkRewardGlyphSet {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--glyph-visual-size);
    height: var(--glyph-visual-size);
    max-width: none;
    max-height: none;
    object-fit: contain;
    pointer-events: none;
    transform: translate(-50%, var(--glyph-visual-shift-y));
}
.afkRewardLootVisual--glyph .afkRewardGlyphBase {
    z-index: 1;
    filter: drop-shadow(0 3px 4px rgba(0,0,0,.48));
}
.afkRewardLootVisual--glyph .afkRewardGlyphSet {
    z-index: 2;
    filter: drop-shadow(0 3px 4px rgba(0,0,0,.38));
}
.afkRewardLootSaleBadge {
    position: absolute;
    left: 50%;
    bottom: 16px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    min-height: 15px;
    padding: 1px 5px 1px 4px;
    border: 1px solid rgba(111, 250, 193, .5);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(4, 61, 56, .95), rgba(3, 41, 38, .98));
    box-shadow: 0 2px 7px rgba(0,0,0,.36), inset 0 1px rgba(255,255,255,.06);
    transform: translateX(-50%);
    pointer-events: none;
}
.afkRewardLootSaleBadge img {
    width: 10px;
    height: 10px;
    max-width: none;
    max-height: none;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.45));
}
.afkRewardLootSaleBadge strong {
    color: #7af0bd;
    font: 900 7px/1 "Poppins", sans-serif;
    text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
@media (max-width: 480px) {
    .afkRewardLoot {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 6px;
    }
    .afkRewardLootItem {
        min-width: 0;
        min-height: 70px;
        padding: 6px 2px 5px;
        flex: none;
    }
    .afkRewardLootVisual {
        width: 100%;
        height: 40px;
    }
    .afkRewardLootVisual img {
        max-width: 34px;
        max-height: 34px;
    }
    .afkRewardLootSaleBadge {
        bottom: 15px;
        min-height: 14px;
        padding: 1px 4px 1px 3px;
    }
    .afkRewardLootSaleBadge strong { font-size: 6px; }
    .afkRewardLootLabel { font-size: 6px; }
}
