/* =========================================
   1. CONFIGURATION GÉNÉRALE (CORE)
   ========================================= */
:root {
    --app-height: 100dvh;
    --app-offset-top: 0px;
    --app-chrome-bottom: 0px;
    /* Jeu déjà sombre. `only dark` est ignoré par d'anciens Blink et
       invalide toute la propriété — `dark` suffit à opt-out Chrome Auto Dark. */
    color-scheme: dark;
}

html {
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    color-scheme: dark;
    background-color: #1e272e;
}

@media (prefers-color-scheme: dark) {
    html {
        color-scheme: dark;
        background-color: #1e272e;
    }
    body {
        color-scheme: dark;
        background-color: #1e272e;
        color: #ffffff;
    }
}

/* Retirer le chrome natif Android (ButtonFace sombre) qui recouvre nos couleurs. */
button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
    appearance: none;
    -webkit-appearance: none;
    color-scheme: dark;
}

body { 
    font-family: 'Lato', sans-serif; 
    background: #1e272e; 
    color: white; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    margin: 0; 
    padding: 5px; 
    user-select: none; 
    min-height: 100vh;
    overflow-x: hidden; 
    overflow-y: auto; /* Permettre le scroll vertical si nécessaire */
    -webkit-tap-highlight-color: transparent; 
    position: relative; /* Pour le positionnement absolu du bouton Paramètres */
}
body.auth-screen-active {
    padding: 0;
    overflow: hidden;
}

/* Transitions */
.screen {
    display: none;
    width: 100%;
    max-width: 1200px;
    animation: fadeIn 0.3s ease-out;
    position: relative;
    margin: 0 auto;
    padding-top: 115px !important; /* Espace pour settings (60px) + bouton close (55px) */
    padding-bottom: max(env(safe-area-inset-bottom, 0px), var(--app-chrome-bottom, 0px));
    box-sizing: border-box;
}

/* =========================================
   2bis. ECRAN DE CONNEXION WALLET
   ========================================= */
#auth-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% + 10px);
    max-width: none;
    min-height: calc(100vh - 20px);
    height: calc(100vh - 20px);
    margin: -5px;
    padding: 16px 18px !important;
    overflow: hidden;
    isolation: isolate;
    background: #08111f;
}

body.auth-screen-active #auth-screen {
    width: 100%;
    min-height: 100vh;
    height: 100vh;
    margin: 0;
}

.auth-bg {
    position: absolute;
    inset: -24px;
    z-index: -3;
    background: url("images/backgrounds/auth_wallet_bg.jpeg") center / cover no-repeat;
    filter: blur(10px) saturate(1.18) brightness(0.84);
    transform: scale(1.04);
}

.auth-vignette {
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(circle at 50% 18%, rgba(94, 232, 255, 0.34), transparent 34%),
        radial-gradient(circle at 18% 80%, rgba(241, 196, 15, 0.24), transparent 28%),
        linear-gradient(180deg, rgba(3, 9, 18, 0.18) 0%, rgba(3, 9, 18, 0.48) 54%, rgba(3, 9, 18, 0.82) 100%);
}

.auth-vignette::after {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(185, 239, 255, 0.34);
    border-radius: 8px;
    box-shadow: 0 0 28px rgba(93, 226, 255, 0.34), inset 0 0 28px rgba(241, 196, 15, 0.12);
    pointer-events: none;
}

.auth-content {
    width: min(470px, 94vw);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    animation: authRise 0.55s ease-out both;
}

.auth-sr-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.auth-logo {
    width: min(370px, 84vw);
    max-height: 31vh;
    object-fit: contain;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.62)) drop-shadow(0 0 18px rgba(71, 229, 255, 0.42));
    transform: translateY(4px);
}

.auth-card {
    width: min(400px, 100%);
    box-sizing: border-box;
    padding: 20px;
    border: 1px solid rgba(255, 221, 103, 0.55);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(15, 28, 45, 0.88), rgba(9, 17, 31, 0.94)),
        rgba(14, 23, 39, 0.92);
    box-shadow:
        0 18px 46px rgba(0, 0, 0, 0.5),
        0 0 34px rgba(44, 214, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(7px);
}

.auth-kicker {
    display: block;
    margin-bottom: 8px;
    color: #75f4ff;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-align: center;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(117, 244, 255, 0.58);
}

.auth-card h2 {
    margin: 0 0 8px;
    color: #ffe066;
    font-size: clamp(23px, 4.5vw, 28px);
    line-height: 1.05;
    text-align: center;
    text-shadow: 0 2px 0 #4f2e00, 0 0 20px rgba(255, 224, 102, 0.4);
}

.auth-card > p {
    margin: 0 0 16px;
    color: #d8f3ff;
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
}

#auth-screen .auth-wallet-btn,
#auth-screen .auth-phantom-link {
    width: 100%;
    min-height: 52px;
    box-sizing: border-box;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
}

#auth-screen .auth-wallet-btn {
    margin-bottom: 12px;
    padding: 13px 16px;
    border: 2px solid rgba(255, 231, 111, 0.78);
    background: linear-gradient(135deg, #7c3cff 0%, #23c7ff 52%, #f6c445 100%);
    color: #ffffff;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.36);
    box-shadow: 0 10px 24px rgba(35, 199, 255, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

#auth-screen .auth-wallet-btn:not(:disabled):hover {
    transform: translateY(-2px);
    filter: brightness(1.11) saturate(1.08);
    box-shadow: 0 14px 30px rgba(35, 199, 255, 0.34), 0 0 24px rgba(246, 196, 69, 0.32);
}

#auth-screen .auth-wallet-btn:disabled {
    border-color: rgba(255, 231, 111, 0.42);
    background: linear-gradient(135deg, #4b3a6d, #31536b) !important;
    color: rgba(255, 255, 255, 0.84);
}

.auth-mobile-hint {
    display: none;
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid rgba(117, 244, 255, 0.32);
    border-radius: 8px;
    background: rgba(5, 14, 27, 0.58);
    color: #ecf8ff;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

.auth-mobile-hint a,
.auth-install-card a {
    color: #75f4ff !important;
    font-weight: 900;
    text-decoration: none !important;
}

.auth-mobile-hint a:hover,
.auth-install-card a:hover {
    color: #ffe066 !important;
}

.auth-phantom-link {
    display: none;
    margin-bottom: 14px;
    padding: 15px 18px;
    border: 2px solid rgba(255, 231, 111, 0.72);
    background: linear-gradient(135deg, #7c3cff, #23c7ff);
    color: #ffffff;
    text-decoration: none;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.34);
}

.auth-error {
    display: none;
    margin-top: 12px;
    padding: 11px 13px;
    border: 1px solid rgba(255, 109, 109, 0.5);
    border-radius: 8px;
    background: rgba(120, 18, 24, 0.58);
    color: #ffd2d2;
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
}

.auth-install-card {
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    color: #b9c8d8;
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

.auth-install-card p {
    margin: 0;
}

.auth-install-card p + p {
    margin-top: 6px;
}

.auth-install-card strong {
    color: #ffe066;
}

@keyframes authRise {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 640px) {
    #auth-screen {
        min-height: calc(100svh - 20px);
        height: calc(100svh - 20px);
        padding: 18px 14px !important;
    }

    body.auth-screen-active #auth-screen {
        min-height: 100svh;
        height: 100svh;
    }

    .auth-vignette::after {
        inset: 8px;
    }

    .auth-content {
        width: min(420px, 94vw);
        gap: 10px;
    }

    .auth-logo {
        width: min(310px, 86vw);
        max-height: 29vh;
    }

    .auth-card {
        padding: 19px 16px;
    }

    .auth-card h2 {
        font-size: 24px;
    }

    .auth-card > p {
        font-size: 14px;
        margin-bottom: 16px;
    }

    #auth-screen .auth-wallet-btn,
    #auth-screen .auth-phantom-link {
        min-height: 52px;
        font-size: 15px;
    }
}

/* Le world-screen n'a pas de bouton close — juste l'espace pour le bloc settings */
#world-screen {
    padding-top: 65px !important;
}

/* Le combat-screen n'a ni settings ni close button — juste le bloc adresse wallet (~48px) */
#combat-screen {
    padding-top: 55px !important;
}

.active-screen { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    margin: 0 auto; /* Centrer le screen */
}

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: scale(0.5); }
    20% { opacity: 1; transform: scale(1.2); }
    40% { opacity: 1; transform: scale(1); }
    60% { opacity: 1; transform: scale(1); }
    80% { opacity: 0.8; transform: scale(0.9); }
    100% { opacity: 0; transform: scale(0.5); }
}

/* =========================================
   CINÉMATIQUE D'ENTRÉE — SALLE DU BOSS
   ========================================= */
.boss-intro-overlay {
    --boss-accent: #f1c40f;
    --boss-accent-rgb: 241, 196, 15;
    --boss-intro-duration: 2200ms;
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: rgba(2, 5, 10, 0.78);
    pointer-events: auto;
    touch-action: none;
    opacity: 0;
}

.boss-intro-overlay[hidden] {
    display: none;
}

.boss-intro-overlay.is-active {
    animation: bossIntroOverlaySequence var(--boss-intro-duration) ease-in-out both;
}

.boss-intro-vignette {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at center, rgba(var(--boss-accent-rgb), 0.12), transparent 44%),
        radial-gradient(circle at center, transparent 30%, rgba(0, 0, 0, 0.88) 100%);
}

.boss-intro-band {
    position: relative;
    width: min(100%, 1180px);
    min-height: clamp(260px, 42vh, 410px);
    border-block: 3px solid var(--boss-accent);
    background:
        linear-gradient(115deg, rgba(var(--boss-accent-rgb), 0.2), transparent 38%),
        linear-gradient(90deg, rgba(6, 9, 16, 0.98), rgba(17, 22, 34, 0.96) 54%, rgba(5, 8, 14, 0.98));
    box-shadow:
        0 0 34px rgba(var(--boss-accent-rgb), 0.48),
        0 24px 70px rgba(0, 0, 0, 0.68);
    clip-path: polygon(2.5% 0, 100% 0, 97.5% 100%, 0 100%);
    transform: translateX(-115%) skewX(-2deg);
}

.boss-intro-overlay.is-active .boss-intro-band {
    animation:
        bossIntroBandSequence var(--boss-intro-duration) cubic-bezier(0.2, 0.78, 0.24, 1) both,
        bossIntroImpact 180ms 540ms linear both;
}

.boss-intro-band::before,
.boss-intro-band::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.38);
}

.boss-intro-band::before { top: 9px; }
.boss-intro-band::after { bottom: 9px; }

.boss-intro-energy {
    position: absolute;
    inset: -30% -10%;
    opacity: 0.42;
    background: repeating-linear-gradient(
        115deg,
        transparent 0 54px,
        rgba(var(--boss-accent-rgb), 0.24) 56px 59px,
        transparent 61px 108px
    );
    transform: translateX(-12%);
}

.boss-intro-overlay.is-active .boss-intro-energy {
    animation: bossIntroEnergySweep 1200ms 280ms ease-out both;
}

.boss-intro-content {
    position: relative;
    z-index: 1;
    width: min(90%, 960px);
    min-height: inherit;
    margin: auto;
    display: grid;
    grid-template-columns: minmax(270px, 0.95fr) minmax(320px, 1.1fr);
    align-items: center;
    gap: clamp(24px, 5vw, 70px);
}

.boss-intro-portrait-wrap {
    position: relative;
    align-self: stretch;
    display: grid;
    place-items: center;
    min-width: 0;
    opacity: 0;
    transform: translateX(-60px) scale(0.72);
}

.boss-intro-overlay.is-active .boss-intro-portrait-wrap {
    animation: bossIntroPortraitReveal 920ms 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.boss-intro-portrait-glow {
    position: absolute;
    width: min(88%, 340px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--boss-accent-rgb), 0.6), transparent 66%);
    filter: blur(18px);
}

.boss-intro-portrait {
    position: relative;
    z-index: 1;
    width: min(100%, 400px);
    height: clamp(250px, 40vh, 400px);
    object-fit: contain;
    filter:
        drop-shadow(0 0 12px rgba(var(--boss-accent-rgb), 0.82))
        drop-shadow(0 18px 12px rgba(0, 0, 0, 0.72));
    user-select: none;
    -webkit-user-drag: none;
}

.boss-intro-copy {
    min-width: 0;
    padding-right: clamp(14px, 4vw, 48px);
    text-align: left;
    opacity: 0;
    transform: translateX(58px);
}

.boss-intro-overlay.is-active .boss-intro-copy {
    animation: bossIntroCopyReveal 720ms 510ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.boss-intro-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--boss-accent);
    font: 900 clamp(17px, 2vw, 25px)/1 Arial, sans-serif;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    text-shadow: 0 0 18px rgba(var(--boss-accent-rgb), 0.72);
}

.boss-intro-label::before {
    content: "";
    width: clamp(32px, 6vw, 74px);
    height: 3px;
    background: var(--boss-accent);
    box-shadow: 0 0 12px rgba(var(--boss-accent-rgb), 0.9);
}

.boss-intro-name {
    margin: 12px 0 9px;
    max-width: 100%;
    color: #fff;
    font: 900 clamp(42px, 7vw, 90px)/0.92 "Trebuchet MS", Arial, sans-serif;
    letter-spacing: -0.055em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
    text-shadow:
        0 3px 0 rgba(0, 0, 0, 0.8),
        0 0 25px rgba(var(--boss-accent-rgb), 0.36);
}

.boss-intro-type {
    display: inline-block;
    padding: 6px 15px;
    border: 1px solid rgba(var(--boss-accent-rgb), 0.66);
    color: #fff;
    background: rgba(var(--boss-accent-rgb), 0.16);
    font: 800 13px/1 Arial, sans-serif;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.boss-intro-overlay.is-step .boss-intro-content {
    width: min(88%, 900px);
    grid-template-columns: 1fr;
    place-items: center;
}

.boss-intro-overlay.is-step .boss-intro-portrait-wrap,
.boss-intro-overlay.is-step .boss-intro-label,
.boss-intro-overlay.is-step .boss-intro-type {
    display: none;
}

.boss-intro-overlay.is-step .boss-intro-copy {
    padding: 0;
    text-align: center;
}

.boss-intro-overlay.is-step .boss-intro-name {
    margin: 0;
    font-size: clamp(58px, 10vw, 124px);
    letter-spacing: 0.08em;
    white-space: nowrap;
}

@media (min-width: 701px) {
    .boss-intro-overlay.is-step .boss-intro-content {
        width: min(88%, 900px);
        grid-template-columns: minmax(0, 1fr);
    }

    .boss-intro-overlay.is-step .boss-intro-copy {
        grid-column: 1 / -1;
        width: min(72vw, 720px);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .boss-intro-overlay.is-step .boss-intro-copy::before,
    .boss-intro-overlay.is-step .boss-intro-copy::after {
        content: "";
        width: clamp(150px, 22vw, 280px);
        height: 3px;
        background: var(--boss-accent);
        box-shadow: 0 0 12px rgba(var(--boss-accent-rgb), 0.9);
    }

    .boss-intro-overlay.is-step .boss-intro-name {
        margin: 18px 0;
    }
}

@keyframes bossIntroOverlaySequence {
    0% { opacity: 0; }
    9%, 82% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes bossIntroBandSequence {
    0% { transform: translateX(-115%) skewX(-2deg); }
    22%, 78% { transform: translateX(0) skewX(-2deg); }
    100% { transform: translateX(115%) skewX(-2deg); }
}

@keyframes bossIntroImpact {
    0%, 100% { margin-left: 0; }
    20% { margin-left: -6px; }
    40% { margin-left: 7px; }
    60% { margin-left: -4px; }
    80% { margin-left: 3px; }
}

@keyframes bossIntroEnergySweep {
    from { opacity: 0; transform: translateX(-26%); }
    to { opacity: 0.42; transform: translateX(12%); }
}

@keyframes bossIntroPortraitReveal {
    0% { opacity: 0; transform: translateX(-60px) scale(0.72); }
    62% { opacity: 1; transform: translateX(4px) scale(1.08); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes bossIntroCopyReveal {
    from { opacity: 0; transform: translateX(58px); }
    to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 700px) {
    .boss-intro-band {
        width: 108%;
        min-height: min(68vh, 570px);
        clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
    }

    .boss-intro-content {
        width: 82%;
        grid-template-columns: 1fr;
        grid-template-rows: minmax(210px, 1fr) auto;
        gap: 2px;
        padding: 16px 0 28px;
    }

    .boss-intro-portrait {
        width: min(90vw, 360px);
        height: min(39vh, 330px);
    }

    .boss-intro-copy {
        padding: 0;
        text-align: center;
    }

    .boss-intro-label {
        justify-content: center;
        font-size: clamp(15px, 4.5vw, 20px);
    }

    .boss-intro-label::before {
        display: none;
    }

    .boss-intro-name {
        margin-top: 9px;
        font-size: clamp(38px, 13vw, 66px);
    }

    .boss-intro-type {
        font-size: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .boss-intro-overlay.is-active,
    .boss-intro-overlay.is-active .boss-intro-band,
    .boss-intro-overlay.is-active .boss-intro-energy,
    .boss-intro-overlay.is-active .boss-intro-portrait-wrap,
    .boss-intro-overlay.is-active .boss-intro-copy {
        animation-duration: var(--boss-intro-duration) !important;
        animation-delay: 0ms !important;
    }

    .boss-intro-overlay.is-active .boss-intro-band {
        animation-name: bossIntroBandReduced;
    }

    .boss-intro-overlay.is-active .boss-intro-portrait-wrap,
    .boss-intro-overlay.is-active .boss-intro-copy {
        animation-name: bossIntroContentReduced;
    }
}

@keyframes bossIntroBandReduced {
    0%, 100% { opacity: 0; transform: none; }
    15%, 85% { opacity: 1; transform: none; }
}

@keyframes bossIntroContentReduced {
    from { opacity: 0; transform: none; }
    to { opacity: 1; transform: none; }
}

/* =========================================
   INTRO PVP — DUEL VS
   ========================================= */
.pvp-intro-overlay {
    --pvp-accent: #e74c3c;
    --pvp-accent-rgb: 231, 76, 60;
    --pvp-intro-duration: 2500ms;
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: rgba(2, 5, 10, 0.82);
    pointer-events: auto;
    touch-action: none;
    opacity: 0;
}

.pvp-intro-overlay[hidden] {
    display: none;
}

.pvp-intro-overlay.is-active {
    animation: pvpIntroOverlaySequence var(--pvp-intro-duration) ease-in-out both;
}

.pvp-intro-vignette {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at center, rgba(var(--pvp-accent-rgb), 0.16), transparent 48%),
        radial-gradient(circle at center, transparent 28%, rgba(0, 0, 0, 0.9) 100%);
}

.pvp-intro-band {
    position: relative;
    width: min(100%, 1180px);
    min-height: clamp(280px, 46vh, 430px);
    border-block: 3px solid var(--pvp-accent);
    background:
        linear-gradient(115deg, rgba(var(--pvp-accent-rgb), 0.22), transparent 38%),
        linear-gradient(90deg, rgba(6, 9, 16, 0.98), rgba(17, 22, 34, 0.96) 54%, rgba(5, 8, 14, 0.98));
    box-shadow:
        0 0 34px rgba(var(--pvp-accent-rgb), 0.48),
        0 24px 70px rgba(0, 0, 0, 0.68);
    clip-path: polygon(2.5% 0, 100% 0, 97.5% 100%, 0 100%);
    transform: translateX(-115%) skewX(-2deg);
}

.pvp-intro-overlay.is-active .pvp-intro-band {
    animation:
        pvpIntroBandSequence var(--pvp-intro-duration) cubic-bezier(0.2, 0.78, 0.24, 1) both,
        pvpIntroImpact 180ms 540ms linear both;
}

.pvp-intro-band::before,
.pvp-intro-band::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.38);
}

.pvp-intro-band::before { top: 9px; }
.pvp-intro-band::after { bottom: 9px; }

.pvp-intro-energy {
    position: absolute;
    inset: -30% -10%;
    opacity: 0.42;
    background: repeating-linear-gradient(
        115deg,
        transparent 0 54px,
        rgba(var(--pvp-accent-rgb), 0.24) 56px 59px,
        transparent 61px 108px
    );
    transform: translateX(-12%);
}

.pvp-intro-overlay.is-active .pvp-intro-energy {
    animation: pvpIntroEnergySweep 1200ms 280ms ease-out both;
}

.pvp-intro-content {
    position: relative;
    z-index: 1;
    width: min(94%, 1040px);
    min-height: inherit;
    margin: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(8px, 2.4vw, 28px);
    padding: 18px 20px 22px;
}

.pvp-intro-fighter {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    opacity: 0;
}

.pvp-intro-overlay.is-active .pvp-intro-fighter.is-left {
    animation: pvpIntroFighterLeft 920ms 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.pvp-intro-overlay.is-active .pvp-intro-fighter.is-right {
    animation: pvpIntroFighterRight 920ms 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.pvp-intro-name {
    max-width: 100%;
    margin: 0 0 10px;
    color: #fff;
    font: 900 clamp(16px, 2.6vw, 28px)/1.1 "Trebuchet MS", Arial, sans-serif;
    letter-spacing: 0.04em;
    text-align: center;
    text-transform: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow:
        0 2px 0 rgba(0, 0, 0, 0.8),
        0 0 18px rgba(var(--pvp-accent-rgb), 0.45);
}

.pvp-intro-portrait-wrap {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
}

.pvp-intro-portrait-glow {
    position: absolute;
    width: min(88%, 280px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--pvp-accent-rgb), 0.55), transparent 66%);
    filter: blur(18px);
}

.pvp-intro-portrait {
    position: relative;
    z-index: 1;
    width: min(100%, 320px);
    height: clamp(170px, 32vh, 320px);
    object-fit: contain;
    filter:
        drop-shadow(0 0 12px rgba(var(--pvp-accent-rgb), 0.82))
        drop-shadow(0 18px 12px rgba(0, 0, 0, 0.72));
    user-select: none;
    -webkit-user-drag: none;
}

.pvp-intro-fighter.is-right .pvp-intro-portrait {
    transform: scaleX(-1);
}

.pvp-intro-vs {
    position: relative;
    z-index: 2;
    color: #e74c3c;
    font: 900 clamp(52px, 11vw, 120px)/0.85 Impact, "Arial Black", Arial, sans-serif;
    letter-spacing: 0.04em;
    text-shadow:
        0 0 18px rgba(231, 76, 60, 0.95),
        0 4px 0 #7b1414,
        0 10px 24px rgba(0, 0, 0, 0.7);
    opacity: 0;
    transform: scale(3) rotate(-12deg);
}

.pvp-intro-overlay.is-active .pvp-intro-vs {
    animation: pvpIntroVsPunch 720ms 480ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes pvpIntroOverlaySequence {
    0% { opacity: 0; }
    9%, 82% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes pvpIntroBandSequence {
    0% { transform: translateX(-115%) skewX(-2deg); }
    22%, 78% { transform: translateX(0) skewX(-2deg); }
    100% { transform: translateX(115%) skewX(-2deg); }
}

@keyframes pvpIntroImpact {
    0%, 100% { margin-left: 0; }
    20% { margin-left: -6px; }
    40% { margin-left: 7px; }
    60% { margin-left: -4px; }
    80% { margin-left: 3px; }
}

@keyframes pvpIntroEnergySweep {
    from { opacity: 0; transform: translateX(-26%); }
    to { opacity: 0.42; transform: translateX(12%); }
}

@keyframes pvpIntroFighterLeft {
    0% { opacity: 0; transform: translateX(-70px) scale(0.72); }
    62% { opacity: 1; transform: translateX(4px) scale(1.06); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes pvpIntroFighterRight {
    0% { opacity: 0; transform: translateX(70px) scale(0.72); }
    62% { opacity: 1; transform: translateX(-4px) scale(1.06); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes pvpIntroVsPunch {
    0% { opacity: 0; transform: scale(3) rotate(-12deg); }
    58% { opacity: 1; transform: scale(0.88) rotate(3deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@media (max-width: 700px) {
    .pvp-intro-band {
        width: 108%;
        min-height: min(58vh, 420px);
        clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
    }

    .pvp-intro-content {
        width: 92%;
        gap: 4px;
        padding: 14px 8px 18px;
    }

    .pvp-intro-portrait {
        width: min(42vw, 180px);
        height: min(28vh, 180px);
    }

    .pvp-intro-vs {
        font-size: clamp(36px, 14vw, 64px);
    }

    .pvp-intro-name {
        font-size: clamp(13px, 3.6vw, 18px);
        margin-bottom: 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pvp-intro-overlay.is-active,
    .pvp-intro-overlay.is-active .pvp-intro-band,
    .pvp-intro-overlay.is-active .pvp-intro-energy,
    .pvp-intro-overlay.is-active .pvp-intro-fighter,
    .pvp-intro-overlay.is-active .pvp-intro-vs {
        animation-duration: var(--pvp-intro-duration) !important;
        animation-delay: 0ms !important;
    }

    .pvp-intro-overlay.is-active .pvp-intro-band {
        animation-name: pvpIntroBandReduced;
    }

    .pvp-intro-overlay.is-active .pvp-intro-fighter,
    .pvp-intro-overlay.is-active .pvp-intro-vs {
        animation-name: pvpIntroContentReduced;
    }
}

@keyframes pvpIntroBandReduced {
    0%, 100% { opacity: 0; transform: none; }
    15%, 85% { opacity: 1; transform: none; }
}

@keyframes pvpIntroContentReduced {
    from { opacity: 0; transform: none; }
    to { opacity: 1; transform: none; }
}

/* =========================================
   2. BOUTON PARAMÈTRES
   ========================================= */
/* Conteneur wrapper pour le bouton Paramètres (positionné en haut à droite, position absolue, disparaît au scroll) */
/* IMPORTANT: Le bouton est positionné par rapport au body, donc il disparaît quand on scroll */
#settings-wrapper {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    bottom: auto !important;
    width: 100% !important;
    height: 0 !important;
    z-index: 99999 !important;
    pointer-events: none !important; /* Permettre les clics à travers, sauf sur le bouton */
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    will-change: auto !important;
    contain: none !important;
}

#settings-selector {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 99999 !important;
    font-family: 'Lato', sans-serif;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important; /* Permettre les interactions sur le bouton */
    transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
    will-change: auto !important;
    contain: none !important;
}

#btn-settings-toggle {
    background: #34495e;
    border: 2px solid #555;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    color: #ecf0f1;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    font-family: 'Lato', sans-serif;
}

#btn-settings-toggle:hover {
    background: #3498db;
    border-color: #2980b9;
    transform: scale(1.05);
}

/* Bouton adresse Solana (en haut à gauche) */
#wallet-address-selector {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 99999 !important;
    font-family: 'Lato', sans-serif;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
    will-change: auto !important;
    contain: none !important;
}

#btn-wallet-address {
    background: #34495e;
    border: 2px solid #555;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 18px;
    color: #ffffff;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    font-family: 'Lato', sans-serif;
    text-shadow: 
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000;
    white-space: nowrap;
}

#btn-wallet-address:hover {
    background: #3498db;
    border-color: #2980b9;
    transform: scale(1.05);
}

#settings-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: #2c3e50;
    border: 2px solid #555;
    border-radius: 8px;
    overflow: hidden;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    animation: fadeIn 0.2s ease-out;
    display: none;
}

.settings-section {
    padding: 10px 0;
}

.settings-section-title {
    padding: 8px 15px;
    color: #f1c40f;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    border-bottom: 1px solid #555;
    margin-bottom: 5px;
}

.language-option {
    width: 100%;
    padding: 10px 15px;
    background: #34495e;
    border: none;
    color: #ecf0f1;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-family: 'Lato', sans-serif;
    transition: background 0.2s ease;
}

.language-option:hover {
    background: #3498db;
}

.language-option:not(:first-child) {
    border-top: 1px solid #555;
}

.confirmation-option {
    width: 100%;
    padding: 10px 15px;
    background: #34495e;
    border: none;
    color: #ecf0f1;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-family: 'Lato', sans-serif;
    transition: background 0.2s ease;
}

.confirmation-option:hover {
    background: #3498db;
}

/* Cacher le bouton Paramètres pendant le combat */
#combat-screen.active-screen ~ #settings-wrapper,
#combat-screen[style*="display: flex"] ~ #settings-wrapper {
    display: none !important;
    visibility: hidden !important;
}

/* Cacher le bouton adresse Solana pendant le combat */
#combat-screen.active-screen ~ #wallet-address-selector,
#combat-screen[style*="display: flex"] ~ #wallet-address-selector {
    display: none !important;
    visibility: hidden !important;
}

/* S'assurer que le bouton est visible sur desktop */
@media (min-width: 901px) {
    #settings-wrapper {
        display: block !important;
        visibility: visible !important;
    }
    #settings-selector {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    #wallet-address-selector {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* =========================================
   3. ÉCRAN DE SÉLECTION (STARTERS)
   ========================================= */
#starter-screen {
    display: none; /* Caché par défaut, affiché uniquement après connexion si nécessaire */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90vh;
}

.starter-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.starter-card {
    background: #2c3e50;
    border: 2px solid #555;
    border-radius: 15px;
    padding: 20px;
    width: 130px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.starter-card:hover {
    transform: scale(1.1) translateY(-5px);
    border-color: #f1c40f;
    background: #34495e;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.starter-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 15px auto;
    font-size: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid rgba(255,255,255,0.2);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
    /* Les dimensions seront ajustées dynamiquement par JavaScript selon size et thickness */
}

/* Redesign responsive de la selection des starters. */
#starter-screen {
    min-height: calc(100vh - 10px);
    max-width: none;
    padding-left: clamp(14px, 4vw, 46px);
    padding-right: clamp(14px, 4vw, 46px);
    padding-bottom: clamp(22px, 5vh, 54px);
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 12%, rgba(214, 255, 151, 0.28), transparent 28%),
        radial-gradient(circle at 86% 10%, rgba(92, 197, 176, 0.24), transparent 30%),
        linear-gradient(135deg, rgba(27, 73, 73, 0.96), rgba(39, 95, 70, 0.95) 54%, rgba(74, 128, 82, 0.96));
    border: 1px solid rgba(190, 255, 196, 0.22);
    box-shadow: inset 0 0 80px rgba(8, 28, 31, 0.75), 0 24px 80px rgba(0, 0, 0, 0.5);
}

#starter-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(237, 255, 228, 0.05) 1px, transparent 1px),
        linear-gradient(180deg, rgba(237, 255, 228, 0.05) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(180deg, transparent, #000 18%, #000 78%, transparent);
    opacity: 0.34;
}

#starter-screen h1 {
    position: relative;
    z-index: 1;
    max-width: min(920px, 100%);
    margin: 0 0 clamp(22px, 4vh, 42px) !important;
    color: #f2ffe8 !important;
    text-align: center !important;
    text-transform: uppercase !important;
    font-size: clamp(32px, 6vw, 64px) !important;
    line-height: 0.95;
    font-weight: 900 !important;
    letter-spacing: 0 !important;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.52);
}

.starter-container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(14px, 2.4vw, 26px);
    width: min(1060px, 100%);
    justify-content: center;
}

.starter-card {
    --starter-accent: #f1c40f;
    min-height: clamp(310px, 42vw, 410px);
    width: auto;
    padding: clamp(16px, 2vw, 22px);
    border: 1px solid rgba(204, 255, 194, 0.24);
    border-radius: 8px;
    background:
        radial-gradient(circle at 50% 24%, color-mix(in srgb, var(--starter-accent) 24%, transparent), transparent 34%),
        linear-gradient(180deg, rgba(75, 126, 103, 0.42), rgba(23, 55, 58, 0.74));
    box-shadow: inset 0 0 34px rgba(197, 255, 199, 0.08), 0 18px 45px rgba(0, 0, 0, 0.26);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    color: #f2ffe8;
    isolation: isolate;
}

.starter-card:nth-child(1) { --starter-accent: #ff6f4a; }
.starter-card:nth-child(2) { --starter-accent: #47b8ff; }
.starter-card:nth-child(3) { --starter-accent: #61e58d; }

.starter-card::before {
    content: "";
    position: absolute;
    left: 8%;
    right: 8%;
    top: 18%;
    height: 46%;
    z-index: -1;
    clip-path: polygon(8% 0, 100% 0, 94% 100%, 0 100%, 0 24%);
    background:
        linear-gradient(180deg, rgba(135, 207, 165, 0.34), rgba(28, 78, 77, 0.28)),
        linear-gradient(90deg, rgba(184, 255, 197, 0.22), rgba(11, 31, 38, 0.1));
    box-shadow:
        inset 0 1px 0 rgba(237, 255, 228, 0.2),
        inset 0 -16px 22px rgba(0, 0, 0, 0.18),
        0 8px 16px rgba(0, 0, 0, 0.16);
}

.starter-card::after {
    content: "01";
    position: absolute;
    top: 13px;
    right: 13px;
    min-width: 34px;
    padding: 6px 8px;
    border-radius: 999px;
    background: rgba(216, 255, 133, 0.16);
    color: #efffb5;
    border: 1px solid rgba(227, 255, 147, 0.34);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.starter-card:nth-child(2)::after { content: "02"; }
.starter-card:nth-child(3)::after { content: "03"; }

.starter-card h3 {
    margin: 12px 0 8px;
    color: #ffffff;
    font-size: clamp(22px, 2.8vw, 30px);
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
}

.starter-card p {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    margin: 0;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--starter-accent) 58%, rgba(255, 255, 255, 0.24));
    background: color-mix(in srgb, var(--starter-accent) 18%, rgba(8, 28, 31, 0.6));
    color: color-mix(in srgb, var(--starter-accent) 84%, #ffffff) !important;
    font-size: 12px;
    font-weight: 900 !important;
    text-transform: uppercase;
    letter-spacing: 0;
}

.starter-card:hover {
    transform: translateY(-8px);
    border-color: color-mix(in srgb, var(--starter-accent) 74%, #ffffff);
    background:
        radial-gradient(circle at 50% 24%, color-mix(in srgb, var(--starter-accent) 32%, transparent), transparent 34%),
        linear-gradient(180deg, rgba(82, 141, 112, 0.5), rgba(22, 57, 58, 0.82));
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--starter-accent) 28%, transparent),
        0 22px 52px rgba(0, 0, 0, 0.38);
}

.starter-icon {
    width: clamp(126px, 18vw, 172px);
    height: clamp(126px, 18vw, 172px);
    margin: clamp(26px, 4vw, 38px) auto 14px auto;
    border: 3px solid color-mix(in srgb, var(--starter-accent) 56%, rgba(255, 255, 255, 0.24));
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.22), transparent 36%),
        linear-gradient(180deg, color-mix(in srgb, var(--starter-accent) 44%, rgba(216, 255, 133, 0.16)), rgba(8, 28, 31, 0.48)) !important;
    box-shadow:
        inset 0 0 24px rgba(255, 255, 255, 0.12),
        inset 0 -20px 28px rgba(0, 0, 0, 0.16),
        0 16px 30px rgba(0, 0, 0, 0.32);
}

.starter-icon img {
    display: block;
    max-width: none;
    object-fit: contain;
    filter: drop-shadow(0 14px 12px rgba(0, 0, 0, 0.38));
}

@media (max-width: 820px) {
    #starter-screen {
        justify-content: flex-start;
        padding-top: 92px !important;
    }

    #starter-screen h1 {
        max-width: 330px;
        font-size: 28px !important;
        line-height: 1.02;
    }

    .starter-container {
        grid-template-columns: 1fr;
        gap: 12px;
        width: min(440px, calc(100vw - 38px));
        max-width: calc(100vw - 38px);
    }

    .starter-card {
        min-height: 148px;
        display: grid;
        grid-template-columns: 108px minmax(0, 1fr);
        align-items: center;
        justify-items: start;
        gap: 14px;
        padding: 12px 14px;
        text-align: left;
    }

    .starter-card::after {
        display: none;
    }

    .starter-card::before {
        left: 84px;
        right: 12px;
        top: 32px;
        height: 78px;
    }

    .starter-icon {
        width: 96px;
        height: 96px;
        margin: 0;
        grid-row: 1 / span 2;
        grid-column: 1;
    }

    .starter-card h3 {
        grid-column: 2;
        margin-top: 0;
        margin-bottom: 4px;
        font-size: 24px;
    }

    .starter-card p {
        grid-column: 2;
        min-height: 28px;
        font-size: 11px;
    }

    .starter-card:hover {
        transform: translateY(-3px);
    }
}

@media (max-width: 380px) {
    #starter-screen {
        padding-left: 10px;
        padding-right: 10px;
    }

    #starter-screen h1 {
        font-size: 26px !important;
    }

    .starter-card {
        grid-template-columns: 86px minmax(0, 1fr);
        min-height: 126px;
        gap: 12px;
    }

    .starter-icon {
        width: 78px;
        height: 78px;
    }

    .starter-card h3 {
        font-size: 21px;
    }
}

/* Starter text panel: name/type on top, description below. */
.starter-card {
    display: grid;
    box-sizing: border-box;
    width: 100%;
    grid-template-columns: minmax(112px, 38%) minmax(0, 1fr) auto;
    grid-template-rows: minmax(26px, 1fr) auto auto minmax(24px, 1fr);
    align-items: center;
    justify-items: stretch;
    column-gap: clamp(10px, 1.6vw, 16px);
    row-gap: 8px;
    text-align: left;
}

.starter-card::before {
    left: 36%;
    right: 8%;
    top: 31%;
    bottom: 20%;
    height: auto;
}

.starter-icon {
    grid-column: 1;
    grid-row: 1 / -1;
    justify-self: center;
    align-self: center;
    margin: 0;
}

.starter-card h3 {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    margin: 0;
    min-width: 0;
    color: color-mix(in srgb, var(--starter-accent) 84%, #ffffff);
}

.starter-card p:not(.starter-description),
.starter-card .starter-type {
    grid-column: 3;
    grid-row: 2;
    align-self: end;
    justify-self: end;
    min-height: 28px;
    max-width: 100%;
    margin: 0;
    padding: 7px 10px;
    white-space: nowrap;
    font-size: 11px;
}

.starter-card .starter-description {
    grid-column: 2 / 4;
    grid-row: 3;
    display: block;
    align-self: start;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(242, 255, 232, 0.72) !important;
    font-size: clamp(12px, 1.45vw, 14px);
    font-style: italic;
    font-weight: 700 !important;
    line-height: 1.35;
    text-transform: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    overflow-wrap: break-word;
}

@media (min-width: 821px) {
    .starter-card {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: minmax(170px, 1fr) auto auto minmax(12px, 0.36fr);
        column-gap: 12px;
        row-gap: 8px;
        align-content: center;
    }

    .starter-card::before {
        left: 8%;
        right: 8%;
        top: 48%;
        bottom: 16%;
    }

    .starter-icon {
        grid-column: 1 / 3;
        grid-row: 1;
        justify-self: center;
        align-self: center;
    }

    .starter-card h3 {
        grid-column: 1;
        grid-row: 2;
        align-self: end;
        padding-left: 13px;
    }

    .starter-card p:not(.starter-description),
    .starter-card .starter-type {
        grid-column: 2;
        grid-row: 2;
        align-self: end;
        justify-self: end;
    }

    .starter-card .starter-description {
        grid-column: 1 / 3;
        grid-row: 3;
        width: auto;
        padding: 0 8px 0 13px;
    }
}

@media (max-width: 820px) {
    .starter-card {
        grid-template-columns: 108px minmax(0, 1fr);
        grid-template-rows: auto auto;
        min-height: 166px;
        align-content: center;
        column-gap: 8px;
        row-gap: 7px;
    }

    .starter-card::before {
        left: 126px;
        right: 14px;
        top: 34px;
        bottom: 28px;
        height: auto;
    }

    .starter-icon {
        grid-row: 1 / span 2;
    }

    .starter-card h3 {
        grid-column: 2;
        grid-row: 1;
        align-self: end;
        padding-left: 5px;
        max-width: calc(100% - 96px);
        font-size: 23px;
    }

    .starter-card p:not(.starter-description),
    .starter-card .starter-type {
        grid-column: 2;
        grid-row: 1;
        align-self: end;
        justify-self: start;
        margin-left: calc(min(118px, 48%) + 5px);
        min-height: 26px;
        width: max-content;
        max-width: 92px;
        box-sizing: border-box;
        padding: 6px 9px;
        font-size: 10px;
    }

    .starter-card .starter-description {
        grid-column: 2;
        grid-row: 2;
        width: min(192px, 100%);
        max-width: 100%;
        padding-left: 5px;
        font-size: 11px;
        line-height: 1.35;
    }
}

@media (max-width: 380px) {
    .starter-card {
        grid-template-columns: 86px minmax(0, 1fr);
        min-height: 150px;
        column-gap: 7px;
    }

    .starter-card::before {
        left: 102px;
        top: 30px;
        bottom: 24px;
    }

    .starter-card p:not(.starter-description),
    .starter-card .starter-type {
        max-width: 86px;
        margin-left: calc(min(96px, 44%) + 5px);
        padding: 5px 8px;
        font-size: 9px;
    }

    .starter-card .starter-description {
        width: min(172px, 100%);
        font-size: 10px;
    }
}

/* =========================================
   4. UI DU MONDE
   ========================================= */
#main-app {
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    max-width: 1100px;
    position: relative;
    margin: 0 auto; /* Centrer le main-app */
    z-index: 1; /* S'assurer que le main-app est en dessous du bouton Paramètres */
}

#world-container {
    position: relative;
    max-width: 800px; 
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1; 
    box-shadow: 0 0 30px rgba(0,0,0,0.6);
    border: 4px solid #444;
    border-radius: 12px;
    background: #2c3e50;
    overflow: hidden;
    z-index: 1; /* S'assurer que la map est en dessous du bouton Paramètres */
}

#worldCanvas {
    width: 100%;
    height: 100%;
    background-color: #34495e;
    touch-action: none;
    cursor: crosshair;
}

.world-zone-loading {
    position: absolute;
    inset: 0;
    z-index: 350;
    align-items: center;
    justify-content: center;
    background: rgba(12, 18, 26, 0.38);
    pointer-events: auto;
}

.world-zone-loading-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    background: rgba(24, 34, 46, 0.88);
    color: #f4f7fb;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.world-zone-loading-spinner {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border: 3px solid rgba(255, 255, 255, 0.22);
    border-top-color: #f1c40f;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.world-zone-loading-text {
    line-height: 1.2;
    white-space: nowrap;
}

/* Bouton Free Spin - Open World (tour gratuit mystery box) */
#free-spin-btn {
    position: absolute;
    width: 54px;
    height: 54px;
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 0;
    z-index: 200;
    transform: translate(-50%, -50%);
    animation: freeSpin-pulse 2s ease-in-out infinite;
    transform-origin: center center;
}
#free-spin-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

#world-quest-btn {
    position: absolute;
    display: none;
    width: 33px;
    height: 33px;
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 0;
    z-index: 201;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    transition: filter 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

#world-quest-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

#world-quest-btn:hover,
#world-quest-btn[aria-expanded="true"] {
    filter: brightness(1.08) saturate(1.08);
    transform: translate(-50%, -50%) scale(1.04);
}

#world-quest-btn:active {
    transform: translate(-50%, -50%) scale(0.96);
}

/* Same HUD size and pulse as the existing Quest and free-spin controls. */
#world-calendar-claim-btn {
    position: absolute;
    width: 33px;
    height: 33px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 201;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    animation: freeSpin-pulse 2s ease-in-out infinite;
}
#world-calendar-claim-btn[hidden] { display: none; }
#world-calendar-claim-btn img { display: block; width: 100%; height: 100%; object-fit: contain; }
#world-calendar-claim-btn:focus-visible { outline: 2px solid #ffe45c; outline-offset: 3px; border-radius: 6px; }

.world-quest-panel {
    position: absolute;
    width: min(250px, calc(100% - 20px));
    padding: 10px;
    background: rgba(35, 24, 16, 0.5);
    border: 2px solid #8b6f47;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
    z-index: 202;
    color: #f4e4bc;
    pointer-events: auto;
}

.world-quest-panel[hidden] {
    display: none;
}

.world-quest-panel-title {
    margin-bottom: 8px;
    color: #f1c40f;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.world-quest-panel-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.world-quest-panel-empty {
    color: #2ecc71;
    font-size: 12px;
    line-height: 1.35;
    text-align: center;
}

.world-quest-row {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 7px;
    align-items: center;
    min-height: 28px;
    padding: 6px 7px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(166, 124, 82, 0.55);
    border-radius: 6px;
}

.world-quest-status {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
}

.world-quest-status.is-complete {
    color: #2ecc71;
    text-shadow: 0 0 6px rgba(46, 204, 113, 0.45);
}

.world-quest-status.is-incomplete {
    color: #e74c3c;
    text-shadow: 0 0 6px rgba(231, 76, 60, 0.45);
}

.world-quest-name {
    min-width: 0;
    color: #f8edd0;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.world-quest-progress {
    display: block;
    margin-top: 2px;
    color: #c8b894;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.2;
}
@media (min-width: 769px) {
    #free-spin-btn { width: 90px; height: 90px; }
    #world-quest-btn { width: 82px; height: 82px; }
    #world-calendar-claim-btn { width: 82px; height: 82px; }
}
@keyframes freeSpin-pulse {
    0%   { opacity: 1;    transform: translate(-50%, -50%) scale(1); }
    50%  { opacity: 0.55; transform: translate(-50%, -50%) scale(0.82); }
    100% { opacity: 1;    transform: translate(-50%, -50%) scale(1); }
}

#sidebar {
    flex: 1; 
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #222;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #444;
    min-height: 400px;
    max-width: 300px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Boutons et minimap positionnés sur le canvas */
.world-canvas-btn {
    width: 142px;
    aspect-ratio: 7 / 4;
    padding: 0;
    background: transparent var(--world-button-asset) center / contain no-repeat;
    color: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
    position: relative;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0;
    letter-spacing: 0;
    transition: transform 0.18s ease, filter 0.18s ease;
    box-shadow: none;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: none;
}

.world-canvas-btn::before {
    display: none;
}

#btn-home-teleport {
    --world-button-asset: url("images/ui/world_btn_hero.png?v=20260622-open-world-buttons");
}

#btn-open-dofemage {
    --world-button-asset: url("images/ui/world_btn_team.png?v=20260622-open-world-buttons");
}

#btn-open-dofedex {
    --world-button-asset: url("images/ui/world_btn_dofedex.png?v=20260622-open-world-buttons");
}

#btn-back-home {
    --world-button-asset: url("images/ui/world_btn_home.png?v=20260622-open-world-buttons");
}

.world-canvas-btn:hover {
    filter: brightness(1.07) saturate(1.08);
    transform: translate(-50%, -50%) translateY(-2px);
}

.world-canvas-btn:active {
    transform: translate(-50%, -50%) scale(0.95);
    filter: brightness(0.96);
}

#world-minimap-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    transform: translate(-50%, calc(-50% - 30px));
    pointer-events: auto;
    touch-action: manipulation;
    width: fit-content;
    height: fit-content;
}

#world-minimap-container #zone-indicator {
    font-size: 12px;
    color: #ffffff;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    text-align: center;
    line-height: 1.2;
    text-shadow: 
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        0 -2px 0 #000,
        0 2px 0 #000,
        -2px 0 0 #000,
        2px 0 0 #000,
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
}

#world-minimap-container #miniMapCanvas {
    width: 67px;
    height: 67px;
    background: #000;
    border: 2px solid #7f8c8d;
    border-radius: 4px;
    image-rendering: pixelated;
    touch-action: none;
    transition: width 0.2s ease, height 0.2s ease;
}

/* Minimap agrandie (double taille) */
#world-minimap-container.minimap-expanded {
    transform: translate(-50%, calc(-50% - 30px));
}

#world-minimap-container.minimap-expanded #miniMapCanvas {
    width: 134px;
    height: 134px;
}

#world-minimap-container.minimap-expanded #zone-indicator {
    font-size: 14px;
    line-height: 1.3;
}

/* Pop-up de minimap x10 */
/* Geometrie fournie par .fullscreen-layer / .overlay-dialog-host : une regle d'id
   qui la redefinit en 100vh gagnerait sur la classe et reintroduirait le bug. */
#minimap-popup-overlay {
    display: none;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100005;
}

#minimap-popup {
    background: #34495e;
    border: 3px solid #f1c40f;
    border-radius: 15px;
    padding: 20px;
    max-width: 670px;
    width: 90%;
    box-shadow: 0 15px 50px rgba(241, 196, 15, 0.3);
    cursor: pointer;
}

#minimap-popup h3 {
    color: #f1c40f;
    margin: 0 0 10px 0;
    font-size: 1.3em;
    text-align: center;
}

#zone-indicator-popup {
    color: #ecf0f1;
    font-size: 14px;
    margin-bottom: 10px;
    text-align: center;
}

#minimap-popup-map-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
}

#miniMapCanvasPopup {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    cursor: pointer;
}

#minimap-popup-hero-marker {
    position: absolute;
    left: var(--hero-x, 50%);
    top: var(--hero-y, 50%);
    width: 5.4%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #f1c40f;
    border: 3px solid #fff;
    box-sizing: border-box;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    animation: minimap-hero-pulse 1.7s ease-in-out infinite;
    z-index: 1;
    box-shadow: 0 0 8px rgba(241, 196, 15, 0.45);
}

@keyframes minimap-hero-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.92);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
}

@media (prefers-reduced-motion: reduce) {
    #minimap-popup-hero-marker {
        animation: none;
    }
}

/* Barre mobile - Masquée sur desktop */
#world-mobile-bar {
    display: none;
}

/* Barre horizontale pour mobile - Organisation en flexbox */
@media (max-width: 768px) {
    #world-mobile-bar {
        position: absolute;
        bottom: 5px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 8px);
        max-width: 100%;
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 4px;
        z-index: 1000;
        pointer-events: none;
        overflow: visible !important;
        padding: 0 4px;
        box-sizing: border-box;
    }
    
    #world-mobile-bar > * {
        pointer-events: auto;
    }
    
    #world-mobile-bar .world-canvas-btn {
        flex: 0 0 clamp(74px, 18vw, 98px);
        width: clamp(74px, 18vw, 98px) !important;
        min-width: 0 !important;
        max-width: none !important;
        aspect-ratio: 7 / 4;
        padding: 0 !important;
        background: transparent var(--world-button-asset) center / contain no-repeat !important;
        color: transparent !important;
        font-size: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        border: 0 !important;
        transform: none !important;
        position: relative !important;
        left: auto !important;
        top: auto !important;
        z-index: 1001 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin: 0 !important;
        text-align: center;
        line-height: 0;
        text-shadow: none !important;
        overflow: visible !important;
    }
    
    #world-mobile-bar #world-minimap-container {
        flex: 0 0 auto;
        padding: 0 !important;
        border-radius: 0;
        border: none !important;
        gap: 1px !important;
        transform: none !important;
        position: relative !important;
        left: auto !important;
        top: auto !important;
        z-index: 1000 !important;
        background: transparent !important;
        box-shadow: none !important;
        margin: 0 !important;
        width: fit-content !important;
        height: fit-content !important;
    }
    
    #world-mobile-bar #world-minimap-container #zone-indicator {
        font-size: 7px !important;
        margin: 0;
        padding: 0;
        letter-spacing: 0.3px;
        line-height: 1;
    }
    
    #world-mobile-bar #world-minimap-container #miniMapCanvas {
        width: 50px !important;
        height: 50px !important;
        margin: 0 !important;
    }
    
    #world-mobile-bar #world-minimap-container.minimap-expanded #miniMapCanvas {
        width: 100px !important;
        height: 100px !important;
    }
    
    #world-mobile-bar #world-minimap-container.minimap-expanded #zone-indicator {
        font-size: 9px !important;
    }
    
}

@media (max-width: 480px) {
    #world-mobile-bar .world-canvas-btn {
        flex-basis: clamp(62px, 17vw, 68px);
        width: clamp(62px, 17vw, 68px) !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: 0 !important;
        font-size: 0 !important;
        border-radius: 0;
        box-shadow: none !important;
        border: 0 !important;
        background: transparent var(--world-button-asset) center / contain no-repeat !important;
        color: transparent !important;
        text-align: center;
        line-height: 0;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-shadow: none !important;
    }
    
    #world-mobile-bar {
        gap: 3px;
        bottom: 3px;
        width: calc(100% - 6px);
        padding: 0 3px;
    }
    
    #world-mobile-bar #world-minimap-container {
        padding: 0 !important;
        border: none !important;
        gap: 1px !important;
        background: transparent !important;
        box-shadow: none !important;
        margin: 0 !important;
        width: fit-content !important;
        height: fit-content !important;
    }
    
    #world-mobile-bar #world-minimap-container #zone-indicator {
        font-size: 6px !important;
        margin: 0 !important;
        padding: 0 !important;
        letter-spacing: 0.2px;
        line-height: 1 !important;
    }
    
    #world-mobile-bar #world-minimap-container #miniMapCanvas {
        width: 45px !important;
        height: 45px !important;
        margin: 0 !important;
    }
    
    #world-mobile-bar #world-minimap-container.minimap-expanded #miniMapCanvas {
        width: 86px !important;
        height: 86px !important;
    }
    
    #world-mobile-bar #world-minimap-container.minimap-expanded #zone-indicator {
        font-size: 8px !important;
    }
    
}

@media (max-width: 360px) {
    #world-mobile-bar .world-canvas-btn {
        flex-basis: clamp(54px, 17vw, 58px);
        width: clamp(54px, 17vw, 58px) !important;
    }

    #world-mobile-bar #world-minimap-container #miniMapCanvas {
        width: 40px !important;
        height: 40px !important;
    }

    #world-mobile-bar #world-minimap-container.minimap-expanded #miniMapCanvas {
        width: 76px !important;
        height: 76px !important;
    }
}

.sidebar-box {
    background: #2c3e50;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

#zone-indicator {
    font-size: 13px;
    color: #f1c40f;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

#miniMapCanvas {
    width: 100%;
    max-width: 120px;
    aspect-ratio: 1/1;
    background: #000;
    border: 2px solid #7f8c8d;
    border-radius: 4px;
    image-rendering: pixelated; 
}

.btn-sidebar {
    width: 100%;
    padding: 12px;
    background: #3498db;
    color: white;
    border: 4px solid #000;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 5px;
    text-transform: uppercase;
    font-size: 12px;
    transition: 0.2s;
    text-shadow: 
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        0 -2px 0 #000,
        0 2px 0 #000,
        -2px 0 0 #000,
        2px 0 0 #000;
}
.btn-sidebar:hover { filter: brightness(1.2); transform: translateY(-2px); }

.info-box {
    font-size: 11px;
    color: #aaa;
    text-align: left;
    line-height: 1.4;
    font-style: italic;
}

/* --- CORRECTION BULLE --- */
#action-bubble {
    position: absolute;
    display: none;
    background: white;
    color: #222;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 13px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
    
    /* On définit juste le transform horizontal ici. 
       Le JS ajoutera la partie verticale (-100% ou 0) */
    transform: translateX(-50%);
    
    cursor: pointer;
    z-index: 100;
    border: 2px solid #c0392b;
    white-space: nowrap; 
}

#action-bubble.action-bubble-vs {
    white-space: normal;
    padding: 8px 14px;
    min-width: 220px;
    max-width: min(420px, calc(100% - 16px));
}

#world-player-menu {
    position: absolute;
    z-index: 230;
    display: none;
    flex-direction: column;
    gap: 8px;
    width: 210px;
    max-width: min(210px, calc(100% - 16px));
    padding: 12px 12px 10px;
    background: rgba(0, 0, 0, 0.72);
    color: #f6edd4;
    border: 2px solid #e6c35c;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    pointer-events: auto;
    box-sizing: border-box;
}

#world-player-menu:not([hidden]) {
    display: flex;
}

.world-player-menu-name {
    font-weight: 800;
    font-size: 22px;
    line-height: 1.15;
    text-align: center;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.world-player-menu-badges {
    display: grid;
    grid-template-columns: repeat(5, 32px);
    justify-content: center;
    gap: 4px;
    width: 100%;
}

.world-player-menu-badges:empty {
    display: none;
}

.world-player-menu-badge {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
}

#world-player-menu button {
    border: 1px solid #e6c35c;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
    color: #f6edd4;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 10px;
    cursor: pointer;
}

#world-player-menu button:hover:not(:disabled) {
    background: rgba(230, 195, 92, 0.18);
}

#world-player-menu button:disabled {
    opacity: 0.45;
    cursor: default;
}

.world-player-menu-note {
    min-height: 0;
    font-size: 11px;
    font-weight: 600;
    color: #d9c99a;
    text-align: center;
}

.world-player-menu-note:empty {
    display: none;
}

.world-vs-bubble {
    display: flex;
    align-items: center;
    gap: 10px;
    font-style: normal;
}

.world-vs-hero {
    flex: 1 1 0;
    text-align: right;
    min-width: 0;
    overflow-wrap: anywhere;
}

.world-vs-label {
    color: #c0392b;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.world-vs-monsters {
    flex: 1 1 0;
    text-align: left;
    font-size: 0.9em;
    font-weight: 700;
    line-height: 1.35;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Lot 15 : OBSERVER, sous le « Héros VS groupe ». Grisé pendant le rodage. */
.world-vs-observe {
    display: block;
    margin: 8px auto 0;
    padding: 5px 16px;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.06em;
    line-height: 1.2;
    cursor: pointer;
}

.world-vs-observe:disabled {
    background: #bdc3c7;
    color: #6c7a89;
    cursor: not-allowed;
}

.world-vs-observe-soon {
    display: block;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0;
}

.world-vs-observe:not(:disabled) .world-vs-observe-soon {
    display: none;
}

@media (max-width: 900px) {
    #main-app {
        flex-direction: column; 
        align-items: center;
    }
    #world-bottom-bar {
        flex-wrap: wrap;
        padding: 10px;
        gap: 8px;
        max-width: 95%;
    }
    .world-bar-btn {
        min-width: 100px;
        max-width: 120px;
        padding: 12px 15px;
        font-size: 11px;
    }
    #world-minimap-container {
        order: -1; /* La minimap en premier sur mobile */
        width: 100%;
        max-width: 100%;
        min-width: auto;
    }
    #world-minimap-container #miniMapCanvas {
        width: 67px;
        height: 67px;
    }
    #sidebar {
        width: 95%;
        max-width: 100%;
        flex-direction: row; 
        flex-wrap: wrap;
        justify-content: space-between;
        min-height: auto;
    }
    .sidebar-box { width: 48%; } 
    .btn-sidebar { width: 48%; }
    .info-box { width: 100%; text-align: center;}
}

/* =========================================
   5. HUB (MAISON)
   ========================================= */
#hub-screen {
    background: #2c3e50;
    padding: 15px;
    border-radius: 12px;
    width: 95%;
    border: 1px solid #444;
    position: relative;
    box-sizing: border-box;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.hub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    width: 100%;
}

.hub-title {
    margin: 0;
    color: #f1c40f;
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.close-btn {
    background: #e74c3c;
    color: white;
    border: 3px solid #c0392b;
    padding: 12px 24px;
    cursor: pointer;
    border-radius: 8px;
    font-weight: bold;
    font-size: 18px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.5), 0 2px 4px rgba(0, 0, 0, 0.6);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    min-width: 100px;
    text-align: center;
    position: absolute;
    top: 62px;
    right: 15px;
}

.close-btn:hover {
    background: #c0392b;
    border-color: #a93226;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.7), 0 4px 8px rgba(0, 0, 0, 0.7);
}

.close-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.5), 0 1px 2px rgba(0, 0, 0, 0.6);
}

.hub-columns {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

/* Optimisation desktop pour le menu - épouse mieux l'écran */
@media (min-width: 901px) {
    #hub-screen.screen {
        width: 98% !important;
        max-width: 1400px !important;
        padding: 20px;
    }
    
    /* Espace pour settings (fixed) + close-btn (fixed) */
    #hub-screen {
        margin-top: 0 !important;
        padding-top: 115px !important;
    }

    #hub-screen .panel {
        width: 380px !important;
        max-width: 380px !important;
    }
    
    #hub-screen .panel#inventory-panel {
        width: 360px !important;
        max-width: 360px !important;
    }
    
    #hub-screen .panel#details-panel-container {
        width: 360px !important;
        max-width: 360px !important;
    }
    
    #hub-screen .hub-columns {
        gap: 30px;
        justify-content: center;
    }
    
    /* Optimisation desktop pour la section TEAM */
    #dofemage-screen.screen {
        width: 98% !important;
        max-width: 1400px !important;
        padding: 20px;
    }
    
    #dofemage-screen .hub-columns:not(.dofemage-layout) {
        max-width: 1400px !important;
        gap: 30px;
        justify-content: center;
    }
    
    #dofemage-screen .hub-columns:not(.dofemage-layout) .panel:first-child {
        width: 50% !important;
        min-width: 500px;
        max-width: 700px !important;
    }
    
    #dofemage-screen .hub-columns:not(.dofemage-layout) .panel:last-child {
        width: 45% !important;
        min-width: 450px;
        max-width: 600px !important;
    }
    
    /* Optimisation desktop pour la section BESTIAIRE */
    #bestiary-screen.screen {
        width: 98% !important;
        max-width: 1400px !important;
        padding: 20px;
    }
    
    #bestiary-screen .hub-columns {
        gap: 30px;
        justify-content: center;
    }
    
    #bestiary-screen .panel {
        width: 360px !important;
        max-width: 360px !important;
    }
}

/* Optimisation mobile pour l'en-tête du hub */
@media (max-width: 768px) {
    #hub-screen {
        width: 100% !important;
        max-width: 100% !important;
        padding: 10px !important;
        border-radius: 0;
        margin: 0;
    }
    
    /* Espace pour settings (fixed) + close-btn (fixed) */
    #hub-screen {
        margin-top: 0 !important;
        padding-top: 115px !important;
    }

    .hub-header {
        padding: 0 5px;
        margin-bottom: 10px;
        position: relative;
    }
    
    .hub-title {
        font-size: 20px;
        letter-spacing: 1px;
    }
    
    .close-btn {
        padding: 10px 20px;
        font-size: 16px;
        min-width: 90px;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        position: absolute;
        top: 62px;
        right: 15px;
        z-index: 9999;
    }
    
    #hub-screen .panel {
        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        padding: 12px;
        margin: 0 auto;
    }
    
    #hub-screen .hub-columns {
        width: 100%;
        padding: 0;
        gap: 15px;
        flex-direction: column;
        align-items: stretch;
        margin-top: 15px;
    }
    
    /* Centrer parfaitement l'avatar du héros entre les deux colonnes d'équipement sur mobile */
    .char-avatar-container {
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}

@media (max-width: 480px) {
    #hub-screen {
        width: 100% !important;
        max-width: 100% !important;
        padding: 5px !important;
        border-radius: 0;
        margin: 0;
    }
    
    /* Espace pour settings (fixed) + close-btn (fixed) */
    #hub-screen {
        margin-top: 0 !important;
        padding-top: 115px !important;
    }
    
    .hub-header {
        padding: 0;
        margin-bottom: 10px;
        position: relative;
    }
    
    .hub-title {
        font-size: 18px;
        letter-spacing: 0.5px;
    }
    
    .close-btn {
        padding: 8px 16px;
        font-size: 14px;
        min-width: 80px;
        text-transform: uppercase;
        letter-spacing: 1px;
        position: absolute;
        top: 62px;
        right: 15px;
        z-index: 9999;
    }
    
    #hub-screen .panel {
        width: calc(100% - 10px) !important;
        max-width: calc(100% - 10px) !important;
        padding: 10px;
        min-height: auto;
        margin: 0 auto;
    }
    
    #hub-screen .hub-columns {
        padding: 0;
        gap: 12px;
        margin-top: 10px;
    }
    
    /* Ajuster la fiche de personnage pour mobile */
    .char-sheet {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 260px;
    }
    
    /* Centrer parfaitement l'avatar du héros entre les deux colonnes d'équipement sur mobile */
    .char-avatar-container {
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
    
    /* Ajuster la grille d'inventaire pour mobile */
    .inv-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 5px;
    }
}

.panel {
    background: #34495e;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #555;
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    min-height: 500px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.section-title {
    color: #f1c40f;
    border-bottom: 2px solid #555;
    margin-bottom: 15px;
    padding-bottom: 8px;
    font-size: 1.3em;
    text-transform: uppercase;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* FICHE PERSO */
.char-sheet {
    position: relative;
    width: 280px;
    height: 260px;
    background: #222;
    border-radius: 15px;
    border: 2px solid #555;
    margin: 0 auto;
    background-image: radial-gradient(circle at center, #333 0%, #222 70%);
}

.char-avatar-container {
    position: absolute;
    top: 80px;
    left: 90px;
    text-align: center;
    width: 100px;
    cursor: help;
}

.char-avatar {
    width: 90px;
    height: 90px;
    background: #3498db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 45px;
    border: 4px solid white;
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.6);
}

.equip-slot {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed #555;
    border-radius: 8px;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 10;
    transition: 0.2s;
}

.equip-slot.filled {
    border: 2px solid #f39c12;
    background: #2c3e50;
    cursor: grab;
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.3);
}

#slot-head   { top: 20px; left: 20px; }
#slot-body   { top: 100px; left: 20px; }
#slot-finger { top: 180px; left: 20px; }
#slot-neck   { top: 20px; right: 20px; }
#slot-hands  { top: 100px; right: 20px; }
#slot-feet   { top: 180px; right: 20px; }

.hero-xp-area { margin-top: 8px; width: 100%; }
.xp-container { 
    background: #444; 
    height: 14px; 
    width: 100%; 
    border-radius: 7px; 
    overflow: hidden; 
    border: 1px solid #000; 
    position: relative;
}
.xp-fill { background: linear-gradient(90deg, #3498db, #2980b9); height: 100%; width: 0%; transition: width 0.5s; }

#hero-xp-text {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 1px #000;
}

.char-stats {
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 8px;
    font-size: 12px;
    border: 1px solid #444;
}

.char-sheet .char-stats {
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
}

.mini-stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 2px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    width: 100%;
}

.stat-val {
    font-weight: bold;
    margin-left: 10px;
}

.inventory-tabs {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    margin-bottom: 5px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 0; /* Ne jamais écraser la barre d'onglets dans un flex-column */
}

.inventory-tabs::-webkit-scrollbar {
    display: none;
}

.inventory-tab {
    flex: 1 0 auto;
    padding: 8px 12px;
    background: #2c3e50;
    border: 4px solid #000;
    border-radius: 4px;
    color: #bdc3c7;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-shadow: 
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        0 -2px 0 #000,
        0 2px 0 #000,
        -2px 0 0 #000,
        2px 0 0 #000;
}

.inventory-tab:hover {
    background: #34495e;
    border-color: #666;
}

.inventory-tab.active {
    background: #3498db;
    border-color: #2980b9;
    color: white;
}

.inv-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 8px;
    min-height: 150px;
    max-height: 300px;
    overflow-y: auto;
}

.item-box {
    width: 42px;
    height: 42px;
    background: #3e4a59;
    border: 1px solid #555;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    position: relative;
    cursor: grab;
    transition: transform 0.1s;
}
.item-box:active { transform: scale(0.9); }

.item-quantity {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.8);
    color: #f1c40f;
    font-size: 10px;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 3px;
    min-width: 14px;
    text-align: center;
    line-height: 1.2;
}

.monster-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: 350px;
}

.card {
    background: #222;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #555;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    cursor: pointer;
    transition: 0.2s;
}

.card:hover { border-color: #f1c40f; transform: translateX(5px); }
.card.selected { border-color: #2ecc71; background: #283747; box-shadow: 0 0 10px rgba(46, 204, 113, 0.2); }

.mon-avatar {
    font-size: 24px;
    width: 40px;
    height: 40px;
    background: #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255,255,255,0.1);
    position: relative;
    overflow: hidden;
}

.squad-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #2ecc71;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    border: 1px solid white;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama).screen {
    background:
        radial-gradient(circle at 18% 12%, rgba(214, 255, 151, 0.28), transparent 28%),
        radial-gradient(circle at 86% 10%, rgba(92, 197, 176, 0.24), transparent 30%),
        linear-gradient(135deg, rgba(27, 73, 73, 0.96), rgba(39, 95, 70, 0.95) 54%, rgba(74, 128, 82, 0.96));
    border: 1px solid rgba(190, 255, 196, 0.22);
    box-shadow: inset 0 0 80px rgba(8, 28, 31, 0.75), 0 24px 80px rgba(0, 0, 0, 0.5);
}

#username-screen.screen {
    position: fixed;
    inset: 0;
    z-index: 8800;
    width: 100vw;
    max-width: none;
    height: 100vh;
    min-height: 100vh;
    margin: 0;
    padding: clamp(18px, 4vh, 40px) 18px !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(circle at 18% 12%, rgba(214, 255, 151, 0.28), transparent 28%),
        radial-gradient(circle at 86% 10%, rgba(92, 197, 176, 0.24), transparent 30%),
        linear-gradient(135deg, rgba(27, 73, 73, 0.96), rgba(39, 95, 70, 0.95) 54%, rgba(74, 128, 82, 0.96));
    border: 1px solid rgba(190, 255, 196, 0.22);
    box-shadow: inset 0 0 80px rgba(8, 28, 31, 0.75), 0 24px 80px rgba(0, 0, 0, 0.5);
}

#username-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(rgba(221, 255, 214, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(221, 255, 214, 0.045) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, transparent, #000 16%, #000 84%, transparent);
}

#username-screen::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(8, 28, 31, 0.04), rgba(8, 28, 31, 0.34)),
        radial-gradient(ellipse at center, transparent 45%, rgba(4, 15, 17, 0.42));
    pointer-events: none;
}

.username-shell {
    width: min(920px, 94vw);
    display: grid;
    grid-template-columns: minmax(260px, 0.92fr) minmax(340px, 440px);
    align-items: center;
    gap: clamp(22px, 5vw, 56px);
}

.username-brand {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.username-logo {
    width: min(430px, 100%);
    max-height: 34vh;
    object-fit: contain;
    filter:
        drop-shadow(0 16px 24px rgba(0, 0, 0, 0.58))
        drop-shadow(0 0 18px rgba(214, 255, 151, 0.28));
}

.username-creature-row {
    width: min(360px, 100%);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.username-creature-row img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    padding: 8px;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid rgba(204, 255, 194, 0.24);
    background:
        radial-gradient(circle at 50% 38%, rgba(216, 255, 133, 0.22), transparent 58%),
        linear-gradient(180deg, rgba(75, 126, 103, 0.42), rgba(23, 55, 58, 0.74));
    box-shadow: inset 0 0 22px rgba(197, 255, 199, 0.08), 0 14px 28px rgba(0, 0, 0, 0.24);
    image-rendering: auto;
}

.username-card {
    width: 100%;
    box-sizing: border-box;
    padding: 28px;
    border-radius: 8px;
    border: 1px solid rgba(204, 255, 194, 0.28);
    background:
        linear-gradient(180deg, rgba(75, 126, 103, 0.52), rgba(23, 55, 58, 0.84)),
        rgba(10, 32, 34, 0.8);
    box-shadow:
        inset 0 0 34px rgba(197, 255, 199, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 22px 54px rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(8px) saturate(1.08);
}

.username-kicker {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(227, 255, 147, 0.34);
    background: rgba(216, 255, 133, 0.16);
    color: #efffb5;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.username-title {
    margin: 0 0 10px;
    color: #f2ffe8;
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.02;
    letter-spacing: 0;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.55);
}

.username-description {
    margin: 0 0 24px;
    color: rgba(242, 255, 232, 0.78);
    font-size: 14px;
    line-height: 1.55;
}

.username-field {
    margin-bottom: 14px;
}

.username-label {
    display: block;
    margin-bottom: 8px;
    color: #efffb5;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.username-input-wrap {
    border-radius: 8px;
    padding: 2px;
    border: 1px solid rgba(204, 255, 194, 0.26);
    background:
        linear-gradient(90deg, rgba(184, 255, 197, 0.2), rgba(11, 31, 38, 0.1)),
        rgba(8, 28, 31, 0.54);
    box-shadow: inset 0 1px 0 rgba(237, 255, 228, 0.12);
}

#username-input {
    width: 100%;
    min-height: 52px;
    box-sizing: border-box;
    padding: 0 14px;
    border: 0;
    border-radius: 6px;
    outline: none;
    background: rgba(9, 29, 32, 0.88);
    color: #f2ffe8;
    font-size: 17px;
    font-weight: 800;
}

#username-input::placeholder {
    color: rgba(242, 255, 232, 0.42);
    font-weight: 700;
}

.username-input-wrap:focus-within {
    border-color: rgba(235, 255, 123, 0.82);
    box-shadow:
        0 0 0 3px rgba(255, 243, 107, 0.2),
        inset 0 1px 0 rgba(237, 255, 228, 0.18);
}

.username-hint {
    margin-top: 7px;
    color: rgba(242, 255, 232, 0.62);
    font-size: 12px;
}

.username-message {
    display: none;
    min-height: 20px;
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
}

.username-message-error {
    color: #ff8f7f;
}

.username-message-success {
    color: #efffb5;
}

#username-screen .username-submit {
    width: 100%;
    min-height: 54px;
    margin: 2px 0 12px;
    padding: 14px 18px;
    border: 2px solid rgba(227, 255, 147, 0.58);
    border-radius: 8px;
    background: linear-gradient(135deg, #d8ff85 0%, #63d394 48%, #2f8f75 100%);
    color: #0b2b2c;
    font-size: 16px;
    font-weight: 900;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.34);
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.24),
        0 0 18px rgba(216, 255, 133, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

#username-screen .username-submit:not(:disabled):hover {
    transform: translateY(-2px);
    filter: brightness(1.06) saturate(1.06);
    box-shadow:
        0 16px 30px rgba(0, 0, 0, 0.3),
        0 0 24px rgba(216, 255, 133, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

#username-screen .username-submit:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    transform: none;
    filter: grayscale(0.18);
}

.username-visible-note {
    margin: 0;
    color: rgba(242, 255, 232, 0.58);
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
}

@media (max-width: 760px) {
    #username-screen.screen {
        height: 100svh;
        min-height: 100svh;
        padding: 16px 14px !important;
        overflow-y: auto;
    }

    .username-shell {
        width: min(430px, 94vw);
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .username-logo {
        width: min(330px, 86vw);
        max-height: 24svh;
    }

    .username-creature-row {
        width: min(270px, 76vw);
        gap: 8px;
    }

    .username-creature-row img {
        padding: 6px;
    }

    .username-card {
        padding: 22px 18px;
    }

    .username-title {
        font-size: clamp(27px, 8vw, 34px);
    }

    .username-description {
        margin-bottom: 18px;
    }
}

@media (max-width: 420px) {
    .username-creature-row {
        display: none;
    }

    .username-card {
        padding: 20px 16px;
    }

    #username-input,
    #username-screen .username-submit {
        min-height: 50px;
    }
}

#quest-screen.screen {
    background:
        radial-gradient(circle at 18% 12%, rgba(214, 255, 151, 0.28), transparent 28%),
        radial-gradient(circle at 86% 10%, rgba(92, 197, 176, 0.24), transparent 30%),
        linear-gradient(135deg, rgba(27, 73, 73, 0.96), rgba(39, 95, 70, 0.95) 54%, rgba(74, 128, 82, 0.96));
    border: 1px solid rgba(190, 255, 196, 0.22);
    box-shadow: inset 0 0 80px rgba(8, 28, 31, 0.75), 0 24px 80px rgba(0, 0, 0, 0.5);
}

#quest-screen .quest-screen-title {
    margin: 0 0 15px 0;
    text-align: center;
    color: #f2ffe8;
    letter-spacing: 0;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.55);
}

#quest-screen .quest-layout {
    width: min(820px, calc(100vw - 28px));
    max-width: 820px;
    justify-content: center;
    margin: 20px auto 0;
}

#quest-screen .quest-panel {
    width: 100%;
    max-width: none;
    min-height: 0;
    border-radius: 8px;
    border: 1px solid rgba(204, 255, 194, 0.24);
    background: linear-gradient(180deg, rgba(75, 126, 103, 0.42), rgba(23, 55, 58, 0.74));
    box-shadow: inset 0 0 34px rgba(197, 255, 199, 0.08), 0 18px 45px rgba(0, 0, 0, 0.26);
}

#quest-screen .quest-sage-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

#quest-screen .quest-sage-portrait {
    width: clamp(132px, 24vw, 188px);
    aspect-ratio: 1;
    padding: 7px;
    border-radius: 8px;
    border: 2px solid rgba(227, 255, 147, 0.48);
    background:
        linear-gradient(180deg, rgba(216, 255, 133, 0.16), rgba(10, 32, 34, 0.42)),
        rgba(8, 28, 31, 0.42);
    box-shadow:
        inset 0 0 22px rgba(197, 255, 199, 0.12),
        0 16px 28px rgba(0, 0, 0, 0.32);
    overflow: hidden;
}

#quest-screen .quest-sage-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#quest-screen .quest-sage-name {
    color: #efffb5;
    margin: 0;
    letter-spacing: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.52);
}

#quest-screen .quest-dialogue,
#quest-screen .quest-list-panel {
    border-radius: 8px;
    border: 1px solid rgba(204, 255, 194, 0.18);
    background: linear-gradient(180deg, rgba(14, 43, 45, 0.72), rgba(20, 53, 48, 0.7));
    box-shadow: inset 0 1px 0 rgba(237, 255, 228, 0.12);
}

#quest-screen .quest-dialogue {
    padding: 15px;
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.6;
}

#quest-screen .quest-dialogue p {
    margin: 0;
    color: #ecf0f1;
}

#quest-screen .quest-list-panel {
    padding: 15px;
}

#quest-screen .quest-list-title {
    margin: 0 0 10px 0;
    color: #efffb5;
    font-size: 14px;
}

#quest-screen .quest-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#hero-skin-screen.screen {
    background:
        radial-gradient(circle at 18% 12%, rgba(214, 255, 151, 0.28), transparent 28%),
        radial-gradient(circle at 86% 10%, rgba(92, 197, 176, 0.24), transparent 30%),
        linear-gradient(135deg, rgba(27, 73, 73, 0.96), rgba(39, 95, 70, 0.95) 54%, rgba(74, 128, 82, 0.96));
    border: 1px solid rgba(190, 255, 196, 0.22);
    box-shadow: inset 0 0 80px rgba(8, 28, 31, 0.75), 0 24px 80px rgba(0, 0, 0, 0.5);
}

#hero-skin-screen .hero-skin-layout {
    width: min(1180px, calc(100vw - 28px));
    max-width: 1180px;
    justify-content: center;
    margin: 20px auto 0;
}

#hero-skin-screen .hero-skin-panel {
    width: 100%;
    max-width: none;
    min-height: 0;
    border-radius: 8px;
    border: 1px solid rgba(204, 255, 194, 0.24);
    background: linear-gradient(180deg, rgba(75, 126, 103, 0.42), rgba(23, 55, 58, 0.74));
    box-shadow: inset 0 0 34px rgba(197, 255, 199, 0.08), 0 18px 45px rgba(0, 0, 0, 0.26);
    position: relative;
}

#hero-skin-screen .hero-skin-header {
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
    align-items: center;
    gap: 22px;
    padding: 6px 8px 22px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(221, 255, 214, 0.22);
}

#hero-skin-screen .hero-skin-showcase {
    aspect-ratio: 1;
    padding: 7px;
    border-radius: 8px;
    border: 2px solid rgba(227, 255, 147, 0.48);
    background:
        linear-gradient(180deg, rgba(216, 255, 133, 0.16), rgba(10, 32, 34, 0.42)),
        rgba(8, 28, 31, 0.42);
    box-shadow:
        inset 0 0 22px rgba(197, 255, 199, 0.12),
        0 16px 28px rgba(0, 0, 0, 0.32);
    overflow: hidden;
}

#hero-skin-screen .hero-skin-showcase-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#hero-skin-screen .hero-skin-heading h2 {
    color: #f2ffe8;
    margin: 0;
    letter-spacing: 0;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.55);
}

#hero-skin-screen .hero-skin-heading p {
    color: rgba(242, 255, 232, 0.72);
    font-size: 14px;
    font-weight: 700;
    margin: 8px 0 0;
}

#hero-skin-screen .hero-skin-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
    gap: 16px;
    padding: 4px 4px 10px;
}

#hero-skin-screen .hero-skin-card {
    min-height: 212px;
    padding: 14px 12px 13px;
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    border: 1px solid rgba(211, 255, 210, 0.14);
    background:
        radial-gradient(circle at 50% 56px, rgba(154, 255, 190, 0.12), transparent 58px),
        linear-gradient(180deg, rgba(12, 34, 37, 0.34), rgba(77, 133, 108, 0.1));
    box-shadow: inset 0 -18px 28px rgba(7, 24, 28, 0.1), 0 12px 24px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

#hero-skin-screen .hero-skin-card:hover {
    transform: translateY(-3px);
    border-color: rgba(235, 255, 123, 0.82);
}

#hero-skin-screen .hero-skin-card.selected {
    border-width: 2px;
    border-color: #fff36b;
    box-shadow:
        0 0 0 3px rgba(255, 243, 107, 0.75),
        0 0 24px rgba(255, 243, 107, 0.42),
        0 12px 28px rgba(0, 0, 0, 0.28);
}

#hero-skin-screen .hero-skin-preview {
    width: 118px;
    height: 118px;
    margin: 0 auto 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid rgba(204, 255, 194, 0.2);
    background:
        linear-gradient(180deg, rgba(12, 34, 37, 0.78), rgba(8, 28, 31, 0.88)),
        rgba(8, 28, 31, 0.86);
    box-shadow: inset 0 0 18px rgba(197, 255, 199, 0.08);
}

#hero-skin-screen .hero-skin-card.selected .hero-skin-preview {
    border-color: rgba(255, 243, 107, 0.86);
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 243, 107, 0.16), transparent 56px),
        linear-gradient(180deg, rgba(12, 34, 37, 0.78), rgba(8, 28, 31, 0.88));
}

#hero-skin-screen .hero-skin-preview-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#hero-skin-screen .hero-skin-preview-fallback {
    font-size: 60px;
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#hero-skin-screen .hero-skin-name {
    margin: 0 0 6px 0;
    color: #efffb5;
    font-size: 16px;
    line-height: 1.2;
    letter-spacing: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.48);
}

#hero-skin-screen .hero-skin-card.selected .hero-skin-name {
    color: #fff36b;
}

#hero-skin-screen .hero-skin-selected-label {
    min-height: 15px;
    color: #fff36b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

#hero-skin-screen .hero-skin-selected-label.is-empty {
    color: transparent;
}

#marabou-screen.screen {
    background:
        radial-gradient(circle at 18% 12%, rgba(220, 128, 255, 0.22), transparent 28%),
        radial-gradient(circle at 86% 10%, rgba(124, 77, 255, 0.24), transparent 30%),
        linear-gradient(135deg, rgba(44, 28, 78, 0.96), rgba(71, 42, 104, 0.95) 54%, rgba(95, 60, 122, 0.96));
    border: 1px solid rgba(231, 192, 255, 0.24);
    box-shadow: inset 0 0 80px rgba(20, 10, 38, 0.78), 0 24px 80px rgba(0, 0, 0, 0.5);
}

#marabou-screen .marabou-screen-title {
    margin: 0 0 15px 0;
    text-align: center;
    color: #f6e8ff;
    letter-spacing: 0;
    text-shadow: 0 3px 14px rgba(0, 0, 0, 0.58), 0 0 20px rgba(189, 92, 255, 0.35);
}

#marabou-screen .marabou-layout {
    width: min(720px, calc(100vw - 28px));
    max-width: 720px;
    justify-content: center;
    margin: 20px auto 0;
}

#marabou-screen .marabou-panel {
    width: 100%;
    max-width: none;
    min-height: 0;
    border-radius: 8px;
    border: 1px solid rgba(231, 192, 255, 0.24);
    background: linear-gradient(180deg, rgba(104, 61, 128, 0.46), rgba(36, 25, 64, 0.78));
    box-shadow: inset 0 0 34px rgba(232, 180, 255, 0.09), 0 18px 45px rgba(0, 0, 0, 0.28);
}

#marabou-screen .marabou-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

#marabou-screen .marabou-portrait {
    width: clamp(142px, 28vw, 204px);
    aspect-ratio: 1;
    padding: 7px;
    border-radius: 8px;
    border: 2px solid rgba(232, 180, 255, 0.54);
    background:
        linear-gradient(180deg, rgba(181, 92, 255, 0.18), rgba(18, 11, 38, 0.46)),
        rgba(20, 10, 38, 0.54);
    box-shadow:
        inset 0 0 24px rgba(232, 180, 255, 0.14),
        0 16px 30px rgba(0, 0, 0, 0.34),
        0 0 24px rgba(189, 92, 255, 0.24);
    overflow: hidden;
}

#marabou-screen .marabou-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#marabou-screen .marabou-name {
    color: #f0d8ff;
    margin: 0;
    letter-spacing: 0;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.52), 0 0 16px rgba(189, 92, 255, 0.32);
}

#marabou-screen .marabou-dialogue,
#marabou-screen .marabou-points-panel {
    border-radius: 8px;
    border: 1px solid rgba(231, 192, 255, 0.18);
    background: linear-gradient(180deg, rgba(31, 20, 55, 0.78), rgba(48, 29, 74, 0.72));
    box-shadow: inset 0 1px 0 rgba(246, 232, 255, 0.12);
}

#marabou-screen .marabou-dialogue {
    padding: 15px;
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.6;
}

#marabou-screen .marabou-dialogue p {
    margin: 0;
    color: #ecf0f1;
}

#marabou-screen .marabou-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px !important;
    color: #ffe66d !important;
    font-weight: 900;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.48);
}

#marabou-screen .marabou-price img,
#marabou-screen #btn-reset-skills img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
}

#marabou-screen .marabou-points-panel {
    padding: 15px;
    margin-bottom: 18px;
}

#marabou-screen .marabou-points-panel h3 {
    margin: 0 0 12px 0;
    color: #f0d8ff;
    font-size: 14px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0;
}

#marabou-screen .marabou-points-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

#marabou-screen .marabou-point-row {
    min-height: 64px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(231, 192, 255, 0.16);
    background:
        radial-gradient(circle at 50% 18%, rgba(189, 92, 255, 0.16), transparent 42px),
        rgba(18, 11, 38, 0.42);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: rgba(246, 232, 255, 0.74);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}

#marabou-screen .marabou-point-total-row {
    grid-column: 1 / -1;
    min-height: 52px;
    flex-direction: row;
    justify-content: space-between;
    padding: 10px 14px;
    border-color: rgba(255, 230, 109, 0.36);
}

#marabou-screen .marabou-point-value {
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

#marabou-screen .marabou-point-hp {
    color: #ff7676;
}

#marabou-screen .marabou-point-force {
    color: #ffb35c;
}

#marabou-screen .marabou-point-init {
    color: #7fd3ff;
}

#marabou-screen .marabou-point-total {
    color: #ffe66d;
    font-size: 18px;
}

#marabou-screen .marabou-reset-area {
    text-align: center;
}

#marabou-screen .marabou-reset-btn {
    width: 100%;
    min-height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 24px;
    border-radius: 8px;
    border: 2px solid rgba(255, 230, 109, 0.72);
    background:
        linear-gradient(180deg, rgba(210, 118, 255, 0.95), rgba(112, 48, 160, 0.98)),
        #9b59b6;
    color: #fff8c9;
    font-size: 16px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.52);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        0 0 20px rgba(189, 92, 255, 0.42),
        0 14px 24px rgba(0, 0, 0, 0.28);
}

#marabou-screen .marabou-reset-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: #ffe66d;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 0 26px rgba(255, 230, 109, 0.34),
        0 16px 28px rgba(0, 0, 0, 0.32);
}

#marabou-screen .marabou-reset-btn:disabled {
    filter: grayscale(0.35);
}

#marabou-screen .marabou-message {
    margin-top: 10px;
    min-height: 20px;
    color: #ffb0c2;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

/* =========================================
   POP-UPS RÉINITIALISATION MARABOU
   ========================================= */
#marabou-reset-popup-overlay {
    display: none;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 18%, rgba(189, 92, 255, 0.28), transparent 42%),
        rgba(8, 4, 18, 0.82);
    z-index: 100016;
}

.marabou-reset-popup {
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    width: min(440px, 92%);
    padding: 28px 26px 24px;
    border-radius: 20px;
    border: 2px solid rgba(232, 180, 255, 0.58);
    background:
        radial-gradient(circle at 18% 8%, rgba(220, 128, 255, 0.28), transparent 36%),
        radial-gradient(circle at 88% 12%, rgba(255, 230, 109, 0.14), transparent 32%),
        linear-gradient(180deg, rgba(71, 42, 104, 0.98), rgba(28, 16, 52, 0.98));
    box-shadow:
        0 0 40px rgba(189, 92, 255, 0.38),
        0 22px 60px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(246, 232, 255, 0.22);
    text-align: center;
    pointer-events: auto;
    animation: marabouResetPopupIn 0.42s ease-out;
}

.marabou-reset-popup-aurora {
    position: absolute;
    inset: -40% -20% auto;
    height: 180px;
    background: conic-gradient(from 180deg, rgba(189, 92, 255, 0.18), rgba(255, 230, 109, 0.12), rgba(124, 77, 255, 0.2), rgba(189, 92, 255, 0.18));
    filter: blur(28px);
    animation: marabouResetAurora 10s linear infinite;
    pointer-events: none;
}

.marabou-reset-popup-sparks {
    position: absolute;
    inset: 12px 16px auto;
    height: 86px;
    pointer-events: none;
}

.marabou-reset-popup-sparks span {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffe66d;
    box-shadow: 0 0 10px rgba(255, 230, 109, 0.9);
    animation: marabouResetSpark 1.8s ease-in-out infinite;
}

.marabou-reset-popup-sparks span:nth-child(1) { left: 12%; top: 18px; animation-delay: 0s; }
.marabou-reset-popup-sparks span:nth-child(2) { left: 28%; top: 4px; animation-delay: 0.25s; background: #f0d8ff; }
.marabou-reset-popup-sparks span:nth-child(3) { left: 50%; top: 10px; animation-delay: 0.5s; }
.marabou-reset-popup-sparks span:nth-child(4) { left: 72%; top: 2px; animation-delay: 0.15s; background: #f0d8ff; }
.marabou-reset-popup-sparks span:nth-child(5) { left: 88%; top: 20px; animation-delay: 0.4s; }

.marabou-reset-popup-eyebrow {
    position: relative;
    margin: 0 0 12px;
    color: #f0d8ff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-shadow: 0 0 12px rgba(189, 92, 255, 0.45);
}

.marabou-reset-popup-portrait {
    position: relative;
    width: 108px;
    height: 108px;
    margin: 0 auto 16px;
    padding: 6px;
    border-radius: 16px;
    border: 2px solid rgba(232, 180, 255, 0.62);
    background:
        linear-gradient(180deg, rgba(181, 92, 255, 0.22), rgba(18, 11, 38, 0.5)),
        rgba(20, 10, 38, 0.54);
    box-shadow:
        inset 0 0 18px rgba(232, 180, 255, 0.18),
        0 0 22px rgba(189, 92, 255, 0.35);
    overflow: hidden;
    animation: marabouResetPortraitIn 0.5s ease-out;
}

.marabou-reset-popup-portrait img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.marabou-reset-popup-title {
    position: relative;
    margin: 0 0 10px;
    color: #ffe66d;
    font-size: 1.55em;
    font-weight: 900;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55), 0 0 18px rgba(255, 230, 109, 0.35);
}

.marabou-reset-popup-message {
    position: relative;
    margin: 0 0 16px;
    color: #f6e8ff;
    font-size: 1.02em;
    line-height: 1.55;
}

.marabou-reset-popup-recovered-label {
    position: relative;
    margin: 0 0 10px;
    color: rgba(246, 232, 255, 0.72);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.marabou-reset-popup-stats {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.marabou-reset-popup-stat {
    min-height: 64px;
    padding: 10px 8px;
    border-radius: 10px;
    border: 1px solid rgba(231, 192, 255, 0.2);
    background:
        radial-gradient(circle at 50% 18%, rgba(189, 92, 255, 0.18), transparent 42px),
        rgba(18, 11, 38, 0.48);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: rgba(246, 232, 255, 0.74);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.marabou-reset-popup-stat-total {
    grid-column: 1 / -1;
    min-height: 48px;
    flex-direction: row;
    justify-content: space-between;
    padding: 10px 14px;
    border-color: rgba(255, 230, 109, 0.38);
}

.marabou-reset-popup-stat-value {
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    text-transform: none;
}

.marabou-reset-popup-stat-hp { color: #ff7676; }
.marabou-reset-popup-stat-force { color: #ffb35c; }
.marabou-reset-popup-stat-init { color: #7fd3ff; }
.marabou-reset-popup-stat-total-value {
    color: #ffe66d;
    font-size: 16px;
}

.marabou-reset-popup-hint {
    position: relative;
    margin: 0 0 18px;
    color: rgba(236, 240, 241, 0.82);
    font-size: 0.92em;
    line-height: 1.5;
}

.marabou-reset-popup-cost {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 230, 109, 0.38);
    background: rgba(18, 11, 38, 0.48);
    color: rgba(246, 232, 255, 0.8);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.marabou-reset-popup-cost[hidden] {
    display: none !important;
}

.marabou-reset-popup-cost-value {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #ffe66d;
    font-size: 16px;
    font-weight: 900;
    text-transform: none;
}

.marabou-reset-popup-cost-value img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.marabou-reset-popup-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    flex: 0 0 auto;
    display: flex;
    gap: 10px;
    margin-top: 4px;
    padding-top: 10px;
    background: linear-gradient(180deg, rgba(28, 16, 52, 0), rgba(28, 16, 52, 0.96) 28%, rgba(28, 16, 52, 0.98));
}

.marabou-reset-popup-actions .marabou-reset-popup-btn {
    flex: 1;
}

.marabou-reset-popup.is-confirm {
    border-color: rgba(255, 179, 92, 0.62);
}

.marabou-reset-popup.is-confirm .marabou-reset-popup-title {
    color: #ffd89a;
}

.marabou-reset-popup-btn.btn,
.marabou-reset-popup-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    margin: 0;
    padding: 12px 16px;
    border-radius: 10px;
    border: 2px solid rgba(255, 230, 109, 0.72);
    background:
        linear-gradient(180deg, rgba(210, 118, 255, 0.95), rgba(112, 48, 160, 0.98)),
        #9b59b6;
    color: #fff8c9;
    font-size: 15px;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.52);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        0 0 18px rgba(189, 92, 255, 0.38),
        0 12px 22px rgba(0, 0, 0, 0.28);
    cursor: pointer;
}

.marabou-reset-popup-btn-cancel[hidden] {
    display: none !important;
}

.marabou-reset-popup-btn-cancel.btn,
.marabou-reset-popup-btn-cancel {
    background: rgba(36, 25, 64, 0.95);
    border-color: rgba(231, 192, 255, 0.32);
    color: #f6e8ff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.marabou-reset-popup-btn:hover {
    transform: translateY(-1px);
    border-color: #ffe66d;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 0 24px rgba(255, 230, 109, 0.32),
        0 14px 24px rgba(0, 0, 0, 0.32);
}

.marabou-reset-popup-btn-cancel:hover {
    border-color: rgba(246, 232, 255, 0.55);
    box-shadow: 0 0 16px rgba(189, 92, 255, 0.22);
}

@keyframes marabouResetPopupIn {
    from { opacity: 0; transform: translateY(18px) scale(0.92); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes marabouResetPortraitIn {
    from { opacity: 0; transform: scale(0.7) rotate(-6deg); }
    to { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes marabouResetAurora {
    to { transform: rotate(360deg); }
}

@keyframes marabouResetSpark {
    0%, 100% { opacity: 0.25; transform: translateY(4px) scale(0.7); }
    50% { opacity: 1; transform: translateY(-7px) scale(1.15); }
}

@media (max-width: 600px) {
    .marabou-reset-popup {
        padding: 22px 18px 18px;
        border-radius: 16px;
    }

    .marabou-reset-popup-portrait {
        width: 88px;
        height: 88px;
    }

    .marabou-reset-popup-title {
        font-size: 1.28em;
    }

    .marabou-reset-popup-stat {
        min-height: 58px;
        font-size: 10px;
    }

    .marabou-reset-popup-stat-value {
        font-size: 18px;
    }

    .marabou-reset-popup-actions {
        gap: 8px;
    }

    .marabou-reset-popup-btn.btn,
    .marabou-reset-popup-btn {
        min-height: 46px;
        font-size: 13px;
        padding: 10px 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .marabou-reset-popup,
    .marabou-reset-popup-portrait,
    .marabou-reset-popup-aurora,
    .marabou-reset-popup-sparks span {
        animation: none;
    }
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-layout {
    width: min(1360px, calc(100vw - 28px));
    max-width: 1360px;
    display: grid;
    grid-template-columns: minmax(0, 1.42fr) minmax(390px, 0.86fr);
    align-items: start;
    gap: 26px;
    margin: 24px auto 0;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-team-panel,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-details-panel {
    width: auto !important;
    max-width: none !important;
    max-height: 78vh;
    border-radius: 8px;
    border: 1px solid rgba(204, 255, 194, 0.24);
    background: linear-gradient(180deg, rgba(75, 126, 103, 0.42), rgba(23, 55, 58, 0.74));
    box-shadow: inset 0 0 34px rgba(197, 255, 199, 0.08), 0 18px 45px rgba(0, 0, 0, 0.26);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-team-panel {
    min-height: 570px;
    display: flex;
    flex-direction: column;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-details-panel {
    position: sticky;
    top: 0;
    overflow-y: auto;
    padding: 0;
}

#dofemage-screen .team-mobile-detail-close,
#bestiary-screen .bestiary-mobile-detail-close,
#hub-screen .hero-item-mobile-detail-close {
    display: none;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-team-header {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px 12px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(221, 255, 214, 0.22);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-team-header > h3:not(.dofemage-title) {
    display: none;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-title,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-details-title {
    color: #f2ffe8;
    margin: 0;
    letter-spacing: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-subtitle {
    margin-top: 4px;
    color: rgba(242, 255, 232, 0.72);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-count {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(216, 255, 133, 0.16);
    color: #efffb5;
    border: 1px solid rgba(227, 255, 147, 0.34);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-monster-list {
    flex: 1;
    max-height: none;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 22px 18px;
    padding: 16px 10px 20px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-team-card {
    min-height: 108px;
    padding: 14px 10px 14px 98px;
    gap: 10px;
    border: 1px solid rgba(211, 255, 210, 0.12);
    border-radius: 8px;
    background:
        radial-gradient(circle at 43px 50px, rgba(154, 255, 190, 0.12), transparent 40px),
        linear-gradient(90deg, rgba(12, 34, 37, 0.24) 0 88px, rgba(77, 133, 108, 0.12) 88px, rgba(77, 133, 108, 0.03));
    box-shadow: inset 0 -18px 28px rgba(7, 24, 28, 0.1), 0 12px 24px rgba(0, 0, 0, 0.1);
    cursor: grab;
    overflow: hidden;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-team-card::before {
    content: "";
    position: absolute;
    left: 104px;
    right: 34px;
    top: 34px;
    bottom: 26px;
    z-index: 0;
    clip-path: polygon(6% 0, 100% 0, 97% 100%, 0 100%, 0 34%);
    background:
        linear-gradient(180deg, rgba(135, 207, 165, 0.34), rgba(28, 78, 77, 0.28)),
        linear-gradient(90deg, rgba(184, 255, 197, 0.2), rgba(11, 31, 38, 0.1));
    border: 0;
    box-shadow:
        inset 0 1px 0 rgba(237, 255, 228, 0.22),
        inset 0 -16px 22px rgba(0, 0, 0, 0.18),
        0 8px 16px rgba(0, 0, 0, 0.16);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-team-card::after {
    content: "";
    position: absolute;
    left: 128px;
    right: 42px;
    bottom: 28px;
    height: 2px;
    z-index: 0;
    background: linear-gradient(90deg, rgba(190, 255, 208, 0.24), rgba(190, 255, 208, 0.1), rgba(190, 255, 208, 0));
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-team-card:hover {
    transform: translateX(4px);
    border-color: rgba(235, 255, 123, 0.82);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-team-card.active {
    border-width: 2px;
    border-color: #fff36b;
    box-shadow:
        0 0 0 3px rgba(255, 243, 107, 0.75),
        0 0 24px rgba(255, 243, 107, 0.45),
        0 12px 28px rgba(0, 0, 0, 0.28);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-avatar-wrap {
    position: absolute;
    left: 13px;
    top: 50%;
    width: 72px;
    height: 92px;
    transform: translateY(-50%);
    filter: drop-shadow(0 9px 12px rgba(0, 0, 0, 0.38));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-avatar-wrap::before {
    content: "";
    position: absolute;
    left: -3px;
    top: 5px;
    width: 78px;
    height: 78px;
    z-index: 0;
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    background:
        radial-gradient(circle at 44% 30%, color-mix(in srgb, var(--dofemon-type-color, #355f58) 78%, white 22%), transparent 58%),
        linear-gradient(180deg, color-mix(in srgb, var(--dofemon-type-color, #355f58) 90%, white 10%), color-mix(in srgb, var(--dofemon-type-color, #355f58) 78%, black 22%)),
        var(--dofemon-type-color, #355f58);
    border: 1px solid rgba(202, 255, 185, 0.24);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -10px 14px rgba(0, 0, 0, 0.2),
        0 7px 14px rgba(0, 0, 0, 0.22);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-avatar-wrap::after {
    content: none;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-creature-sprite {
    position: absolute;
    left: 36px;
    top: 44px;
    max-width: 84px;
    max-height: 84px;
    transform: translate(-50%, -50%);
    object-fit: contain;
    z-index: 2;
    pointer-events: none;
    filter: drop-shadow(0 5px 6px rgba(0, 0, 0, 0.46));
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-creature-fallback {
    position: absolute;
    left: 36px;
    top: 44px;
    width: 72px;
    height: 72px;
    transform: translate(-50%, -50%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.62);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-team-card .squad-badge {
    top: 6px;
    right: auto;
    left: 7px;
    bottom: auto;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    background: linear-gradient(180deg, rgba(30, 42, 48, 0.98), rgba(11, 20, 26, 0.98));
    color: #f7fff2;
    border: 1px solid rgba(218, 255, 202, 0.62);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.16);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    z-index: 6;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-level-badge {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    margin-top: 0;
    min-width: 52px;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(18, 29, 34, 0.88);
    border: 1px solid rgba(235, 255, 182, 0.48);
    color: #f7ffe1;
    font-size: 10px;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
    z-index: 2;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-card-body {
    min-width: 0;
    flex: 1;
    position: relative;
    z-index: 3;
    padding-top: 3px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-card-name {
    display: flex;
    align-items: center;
    gap: 6px;
    width: min(100%, 300px);
    height: 24px;
    padding: 0 22px 0 22px;
    clip-path: polygon(7% 0, 100% 0, 96% 100%, 0 100%, 0 40%);
    background:
        linear-gradient(180deg, rgba(82, 149, 133, 0.7), rgba(31, 82, 80, 0.58)),
        linear-gradient(90deg, rgba(188, 255, 206, 0.18), rgba(255, 255, 255, 0) 88%);
    border: 0;
    color: #f7fff2;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left: 0;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -8px 10px rgba(0, 0, 0, 0.12),
        0 3px 9px rgba(0, 0, 0, 0.16);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-card-name::before {
    content: "";
    position: absolute;
    left: 12px;
    right: 10px;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(223, 255, 219, 0.34), rgba(223, 255, 219, 0.12), rgba(223, 255, 219, 0));
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-card-name::after {
    content: none;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-gender {
    color: #dfff6c;
    font-size: 15px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-bars {
    display: grid;
    gap: 5px;
    margin-top: 5px;
    max-width: 304px;
    padding-left: 15px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-stat-row {
    min-width: 0;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-bar {
    position: relative;
    height: 18px;
    border-radius: 5px 999px 999px 5px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(20, 31, 39, 0.98), rgba(7, 16, 23, 0.98));
    border: 2px solid rgba(10, 23, 29, 0.92);
    box-shadow:
        0 0 0 1px rgba(197, 244, 213, 0.25),
        0 4px 8px rgba(0, 0, 0, 0.36),
        inset 0 2px 5px rgba(0, 0, 0, 0.78);
    transform: skewX(-10deg);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-bar-fill {
    height: 100%;
    border-radius: inherit;
    position: relative;
    min-width: 4px;
    box-shadow:
        inset 0 2px 3px rgba(255, 255, 255, 0.34),
        inset 0 -3px 5px rgba(0, 0, 0, 0.3);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-bar-fill::after {
    content: "";
    position: absolute;
    left: 3px;
    right: 3px;
    top: 2px;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.42);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-bar-fill.hp {
    background: linear-gradient(180deg, #ff5a72 0%, #f3264c 48%, #b90a2c 100%);
    box-shadow:
        inset 0 2px 3px rgba(255, 255, 255, 0.36),
        inset 0 -3px 5px rgba(83, 0, 16, 0.44),
        0 0 12px rgba(255, 49, 91, 0.54);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-bar-fill.xp {
    background: linear-gradient(180deg, #67fff2 0%, #22d7c8 48%, #0a8f8b 100%);
    box-shadow:
        inset 0 2px 3px rgba(255, 255, 255, 0.4),
        inset 0 -3px 5px rgba(0, 63, 68, 0.48),
        0 0 12px rgba(40, 214, 194, 0.58);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-hp-bar {
    width: min(100%, 286px);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-xp-bar {
    width: min(100%, 254px);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-bar-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f8fffd;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 5px rgba(0, 0, 0, 0.65);
    transform: skewX(10deg);
    pointer-events: none;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-details-title {
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(221, 255, 214, 0.22);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-details-content,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) #team-details-panel {
    padding: 18px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-empty-state {
    color: rgba(235, 250, 232, 0.62);
    font-style: italic;
    text-align: center;
    padding: 42px 18px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-detail-card {
    --dofemon-card-ink: #f7fbff;
    --dofemon-card-muted: rgba(236, 246, 255, 0.72);
    --dofemon-card-panel: rgba(14, 26, 36, 0.78);
    --dofemon-card-trim: color-mix(in srgb, var(--dofemon-card-color, #8fb8c8) 76%, white 24%);
    --dofemon-theme-color: var(--dofemon-card-color, #8fb8c8);
    --dofemon-theme-bright: color-mix(in srgb, var(--dofemon-theme-color) 68%, white 32%);
    --dofemon-theme-soft: color-mix(in srgb, var(--dofemon-theme-color) 34%, transparent);
    --dofemon-frame-a: #53616e;
    --dofemon-frame-b: #23313a;
    --dofemon-frame-c: #0c141c;
    --dofemon-card-bg-url: url("images/backgrounds/normal.png");
    --dofemon-card-art-position: center 50%;
    width: min(100%, 430px);
    margin: 0 auto;
    color: var(--dofemon-card-ink);
    filter: drop-shadow(0 24px 36px rgba(0, 0, 0, 0.38));
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-frame {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    padding: 11px;
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.18), transparent 22%),
        radial-gradient(circle at 50% 0, color-mix(in srgb, var(--dofemon-card-color, #8fb8c8) 38%, transparent), transparent 46%),
        linear-gradient(180deg, rgba(35, 49, 58, 0.98), rgba(8, 17, 27, 0.98));
    border: 2px solid var(--dofemon-card-trim);
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.08),
        inset 0 -28px 45px rgba(0, 0, 0, 0.34),
        0 0 28px color-mix(in srgb, var(--dofemon-card-color, #8fb8c8) 34%, transparent);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-frame::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    pointer-events: none;
    z-index: 1;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(112deg, transparent 0 34%, rgba(255, 255, 255, 0.12) 42%, transparent 52%),
        radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.18), transparent 18%);
    mix-blend-mode: screen;
    opacity: 0.42;
    pointer-events: none;
    z-index: 2;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-top,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-art,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-body,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-footer {
    position: relative;
    z-index: 3;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-top {
    display: grid;
    grid-template-columns: minmax(58px, 0.7fr) minmax(0, 1.4fr) minmax(70px, 0.8fr);
    align-items: center;
    gap: 8px;
    min-height: 34px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-top-badge,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-name {
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--dofemon-card-color, #8fb8c8) 62%, white 20%);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.18)),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0)),
        rgba(7, 17, 25, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 5px 12px rgba(0, 0, 0, 0.22);
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-top-badge {
    padding: 8px 7px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-name {
    min-width: 0;
    padding: 9px 8px;
    color: color-mix(in srgb, var(--dofemon-card-color, #8fb8c8) 78%, white 22%);
    font-size: clamp(14px, 2.7vw, 19px);
    letter-spacing: 0;
    text-shadow:
        0 0 10px color-mix(in srgb, var(--dofemon-card-color, #8fb8c8) 46%, transparent),
        0 2px 8px rgba(0, 0, 0, 0.86);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-hp {
    color: #ffd9df;
    border-color: rgba(255, 104, 126, 0.72);
    font-size: 14px;
    padding-left: 9px;
    padding-right: 9px;
    letter-spacing: 0;
    text-shadow: 0 0 10px rgba(255, 65, 98, 0.58), 0 2px 7px rgba(0, 0, 0, 0.8);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 14px rgba(255, 72, 103, 0.26);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-art {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 9px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.18);
    background:
        radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--dofemon-card-color, #8fb8c8) 36%, transparent), transparent 34%),
        linear-gradient(180deg, rgba(41, 62, 76, 0.86), rgba(9, 20, 31, 0.94));
    box-shadow:
        inset 0 0 28px rgba(255, 255, 255, 0.1),
        inset 0 -34px 42px rgba(0, 0, 0, 0.42);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-art::before,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-art::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-art::before {
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 34px 34px;
    opacity: 0.22;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-art::after {
    content: none;
    left: 16px;
    right: 16px;
    bottom: 43px;
    height: 1px;
    background: none;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-art-glow {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--dofemon-card-color, #8fb8c8) 42%, transparent), transparent 68%);
    filter: blur(8px);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-monster-img {
    position: relative;
    z-index: 2;
    object-fit: contain;
    image-rendering: auto;
    filter: drop-shadow(0 15px 15px rgba(0, 0, 0, 0.54));
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-monster-fallback {
    position: relative;
    z-index: 2;
    display: none;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 140px;
    font-size: 58px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-art-stats {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    z-index: 4;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-art-stats > div {
    --stat-color: var(--dofemon-card-color, #8fb8c8);
    min-width: 0;
    padding: 6px 5px;
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(0, 0, 0, 0.18)),
        rgba(7, 16, 24, 0.8);
    border: 1px solid color-mix(in srgb, var(--stat-color) 62%, white 18%);
    text-align: center;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -10px 16px rgba(0, 0, 0, 0.24),
        0 6px 12px rgba(0, 0, 0, 0.26);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-art-stats > .dofemon-card-stat-init {
    --stat-color: #42a5ff;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-art-stats > .dofemon-card-stat-mp {
    --stat-color: #3ee37c;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-art-stats > .dofemon-card-stat-force {
    --stat-color: #ffd447;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-art-stats span {
    display: block;
    color: color-mix(in srgb, var(--stat-color) 68%, white 32%);
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-art-stats strong {
    display: block;
    margin-top: 3px;
    color: color-mix(in srgb, var(--stat-color) 84%, white 16%);
    font-size: 16px;
    line-height: 1;
    text-shadow: 0 0 10px color-mix(in srgb, var(--stat-color) 46%, transparent), 0 2px 5px rgba(0, 0, 0, 0.88);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-body {
    margin-top: 9px;
    padding: 10px;
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.12)),
        var(--dofemon-card-panel);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-section-title {
    color: color-mix(in srgb, var(--dofemon-card-color, #8fb8c8) 36%, white 64%);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-passive {
    --passive-color: rgba(190, 235, 255, 0.42);
    min-height: 42px;
    margin-top: 6px;
    padding: 8px 9px;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.08)),
        rgba(0, 0, 0, 0.2);
    border: 1px solid color-mix(in srgb, var(--passive-color) 68%, rgba(255, 255, 255, 0.12));
    box-shadow:
        inset 0 0 16px color-mix(in srgb, var(--passive-color) 18%, transparent),
        0 0 8px color-mix(in srgb, var(--passive-color) 12%, transparent);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-passive.dofemon-card-passive--none {
    --passive-color: rgba(145, 162, 174, 0.42);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-passive.dofemon-card-passive--common {
    --passive-color: #86d68e;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-passive.dofemon-card-passive--rare {
    --passive-color: #4aa9ff;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-passive.dofemon-card-passive--legendary {
    --passive-color: #f3c64b;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-passive-name {
    color: color-mix(in srgb, var(--passive-color) 72%, white 28%);
    font-size: 12px;
    font-weight: 900;
    text-shadow: 0 0 8px color-mix(in srgb, var(--passive-color) 36%, transparent);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-passive-desc,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-passive-empty {
    margin-top: 4px;
    color: var(--dofemon-card-muted);
    font-size: 11px;
    line-height: 1.35;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-passive--none .dofemon-card-passive-empty {
    color: rgba(222, 232, 238, 0.7);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spells-title {
    margin-top: 9px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spells {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 6px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell {
    --spell-type-color: var(--dofemon-card-color, #8fb8c8);
    min-width: 0;
    height: 32px;
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    padding: 0 7px;
    border-radius: 7px;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0)),
        rgba(4, 12, 18, 0.72);
    border: 1px solid color-mix(in srgb, var(--spell-type-color) 44%, rgba(255, 255, 255, 0.08));
    color: #f8fcff;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell--fire { --spell-type-color: #ff7045; }
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell--water { --spell-type-color: #39a8ff; }
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell--grass { --spell-type-color: #42d678; }
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell--electric { --spell-type-color: #ffe04f; }
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell--wind { --spell-type-color: #9bdcff; }
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell--ground { --spell-type-color: #c79a62; }
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell--psychic { --spell-type-color: #c77dff; }
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell--dark { --spell-type-color: #8d7bff; }
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell--light { --spell-type-color: #ffe9a6; }
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell--steel { --spell-type-color: #b9c7d4; }
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell--dragon { --spell-type-color: #ff9d4d; }
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell--normal { --spell-type-color: #c6ced6; }

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell:hover,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell.is-selected {
    border-color: color-mix(in srgb, var(--spell-type-color) 82%, white 18%);
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--spell-type-color) 24%, transparent), rgba(255, 255, 255, 0.03)),
        rgba(5, 15, 24, 0.88);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 12px color-mix(in srgb, var(--spell-type-color) 44%, transparent);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell.is-selected::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 0 999px 999px 0;
    background: var(--spell-type-color);
    box-shadow: 0 0 8px var(--spell-type-color);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-index {
    width: 20px;
    height: 20px;
    justify-self: center;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--spell-type-color) 26%, rgba(255, 255, 255, 0.1));
    border: 1px solid color-mix(in srgb, var(--spell-type-color) 44%, transparent);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-index--emblem {
    width: 26px;
    height: 26px;
    padding: 0;
    overflow: hidden;
    border-radius: 6px;
    background: rgba(4, 8, 12, 0.64);
    border: 1px solid color-mix(in srgb, var(--spell-type-color) 44%, rgba(255, 255, 255, 0.24));
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.12),
        0 0 8px color-mix(in srgb, var(--spell-type-color) 34%, transparent);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-index--emblem img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    border-radius: inherit;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-name {
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-type {
    color: color-mix(in srgb, var(--spell-type-color) 72%, white 28%);
    font-size: 8px;
    font-weight: 900;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-detail {
    min-height: 52px;
    margin-top: 7px;
    padding: 8px 9px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.11);
    color: rgba(235, 245, 255, 0.86);
    font-size: 10px;
    line-height: 1.35;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-detail strong,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-detail span,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-detail em {
    display: block;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-detail strong {
    color: #fff;
    font-size: 12px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-detail em {
    margin-top: 4px;
    color: color-mix(in srgb, var(--dofemon-card-color, #8fb8c8) 42%, white 58%);
    font-style: normal;
    font-weight: 800;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-detail {
    min-height: 154px;
    display: grid;
    gap: 6px;
    padding: 9px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--dofemon-theme-bright) 8%, transparent), rgba(0, 0, 0, 0.08)),
        rgba(2, 8, 14, 0.44);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-detail-header {
    min-width: 0;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-emblem {
    width: 38px;
    height: 38px;
    justify-self: center;
    align-self: center;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #081018;
    font-size: 17px;
    font-weight: 1000;
    line-height: 1;
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.2) 31%, transparent 35%),
        linear-gradient(145deg, color-mix(in srgb, var(--spell-type-color) 76%, white 24%), color-mix(in srgb, var(--spell-type-color) 72%, black 28%));
    border: 1px solid color-mix(in srgb, var(--spell-type-color) 78%, white 22%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.18),
        0 0 12px color-mix(in srgb, var(--spell-type-color) 42%, transparent);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-emblem--image {
    padding: 0;
    overflow: hidden;
    color: transparent;
    background: rgba(4, 8, 12, 0.64);
    border-color: color-mix(in srgb, var(--spell-type-color) 44%, rgba(255, 255, 255, 0.24));
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.12),
        0 0 12px color-mix(in srgb, var(--spell-type-color) 34%, transparent);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-emblem--image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    border-radius: inherit;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-detail-name {
    min-width: 0;
    overflow: hidden;
    color: color-mix(in srgb, var(--spell-type-color) 78%, white 22%);
    font-size: 20px;
    font-weight: 1000;
    line-height: 1.2;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 0 9px color-mix(in srgb, var(--spell-type-color) 44%, transparent);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-detail-type {
    min-width: 48px;
    padding: 5px 7px;
    border-radius: 6px;
    color: color-mix(in srgb, var(--spell-type-color) 78%, white 22%);
    font-size: 9px;
    font-weight: 1000;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    background: color-mix(in srgb, var(--spell-type-color) 14%, rgba(0, 0, 0, 0.42));
    border: 1px solid color-mix(in srgb, var(--spell-type-color) 40%, rgba(255, 255, 255, 0.12));
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-detail-primary,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-detail-secondary {
    padding: 6px 8px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.09);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-detail-primary {
    color: rgba(255, 255, 255, 0.96);
    font-size: 14px;
    font-weight: 900;
    text-align: center;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-detail-primary--damage {
    color: color-mix(in srgb, var(--spell-type-color) 78%, white 22%);
    text-shadow: 0 0 8px color-mix(in srgb, var(--spell-type-color) 32%, transparent);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-detail-secondary {
    color: rgba(230, 241, 249, 0.86);
    font-size: 10px;
    line-height: 1.3;
    text-align: center;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-detail-secondary span + span {
    margin-top: 3px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-detail-metrics {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(52px, auto);
    gap: 5px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-detail-metrics span {
    min-width: 0;
    padding: 5px 6px;
    border-radius: 6px;
    overflow-wrap: anywhere;
    color: rgba(240, 247, 255, 0.9);
    font-size: 9px;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-detail-description {
    padding-top: 2px;
    border-top: 1px solid color-mix(in srgb, var(--dofemon-theme-bright) 16%, transparent);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-detail-description span {
    color: color-mix(in srgb, var(--dofemon-theme-bright) 42%, white 58%);
    font-size: 9px;
    font-weight: 1000;
    text-transform: uppercase;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell-detail-description p {
    margin: 3px 0 0;
    color: var(--dofemon-card-muted);
    font-size: 10px;
    line-height: 1.28;
}

#dofedex-screen .dofemon-card-spell-learn-level {
    margin-top: 6px;
    padding: 6px 7px;
    border-radius: 6px;
    border: 1px solid color-mix(in srgb, var(--dofemon-theme-bright) 24%, transparent);
    background: color-mix(in srgb, var(--dofemon-theme-color) 14%, rgba(0, 0, 0, 0.24));
    color: color-mix(in srgb, var(--dofemon-theme-bright) 58%, white 42%);
    font-size: 10px;
    font-weight: 900;
    line-height: 1.2;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-footer {
    min-height: 38px;
    display: grid;
    grid-template-columns: minmax(112px, auto) minmax(0, 1fr);
    gap: 10px;
    align-items: end;
    margin-top: 7px;
    padding: 0 2px 1px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-registry {
    color: rgba(245, 250, 255, 0.78);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-registry span {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    margin-left: 4px;
    border-radius: 50%;
    color: #0b1118;
    background:
        radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.2) 34%, transparent 36%),
        linear-gradient(180deg, #ffffff, #cfddea);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.42),
        0 0 9px color-mix(in srgb, var(--dofemon-card-color, #8fb8c8) 35%, transparent);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-flavor {
    color: rgba(245, 250, 255, 0.74);
    font-size: 10px;
    font-style: italic;
    line-height: 1.25;
    text-align: right;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--wind {
    --dofemon-card-color: #9bdcff;
    --dofemon-card-panel: rgba(9, 23, 38, 0.78);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--wind .dofemon-card-frame {
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.24), transparent 18%),
        radial-gradient(circle at 20% 14%, rgba(255, 255, 255, 0.36), transparent 22%),
        radial-gradient(circle at 82% 18%, rgba(115, 220, 255, 0.28), transparent 32%),
        radial-gradient(circle at 50% 100%, rgba(61, 144, 205, 0.28), transparent 38%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 16px),
        linear-gradient(165deg, #5b748e, #122a42 52%, #07121f);
    border-color: rgba(201, 239, 255, 0.9);
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.12),
        inset 0 -28px 45px rgba(0, 0, 0, 0.34),
        0 0 34px rgba(113, 213, 255, 0.24),
        0 18px 38px rgba(0, 0, 0, 0.4);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--wind .dofemon-card-frame::before {
    border-color: rgba(215, 244, 255, 0.24);
    box-shadow:
        inset 0 0 0 1px rgba(110, 207, 255, 0.12),
        inset 0 0 22px rgba(98, 192, 255, 0.1);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--wind .dofemon-card-frame::after {
    background:
        linear-gradient(112deg, transparent 0 28%, rgba(255, 255, 255, 0.17) 39%, transparent 51%),
        radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.22), transparent 18%),
        radial-gradient(circle at 12% 88%, rgba(105, 213, 255, 0.2), transparent 18%);
    opacity: 0.5;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--wind .dofemon-card-top::before,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--wind .dofemon-card-footer::before {
    content: "✦";
    position: absolute;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    color: rgba(226, 249, 255, 0.8);
    font-size: 10px;
    border-radius: 50%;
    background: rgba(171, 230, 255, 0.14);
    border: 1px solid rgba(218, 246, 255, 0.32);
    box-shadow: 0 0 10px rgba(128, 219, 255, 0.28);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--wind .dofemon-card-top::before {
    left: -2px;
    top: -25px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--wind .dofemon-card-footer::before {
    right: 1px;
    bottom: 47px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--wind .dofemon-card-art {
    background:
        linear-gradient(180deg, rgba(58, 110, 145, 0.08), rgba(5, 14, 26, 0.18)),
        radial-gradient(ellipse at 50% 44%, rgba(222, 252, 255, 0.5), transparent 25%),
        radial-gradient(ellipse at 22% 24%, rgba(255, 255, 255, 0.52), transparent 15%),
        url("images/backgrounds/wind.png"),
        linear-gradient(145deg, #7ec7e8 0%, #496f9b 46%, #1d2d52 100%);
    background-size: cover;
    background-position: center 47%;
    border-color: rgba(182, 233, 255, 0.62);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.14),
        inset 0 -46px 52px rgba(6, 20, 36, 0.56),
        0 0 18px rgba(130, 218, 255, 0.18);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--wind .dofemon-card-art::before {
    background:
        repeating-radial-gradient(ellipse at 50% 48%, transparent 0 24px, rgba(255, 255, 255, 0.18) 25px 27px, transparent 28px 44px),
        linear-gradient(115deg, transparent 0 18%, rgba(255, 255, 255, 0.34) 33%, transparent 50%),
        linear-gradient(24deg, transparent 0 46%, rgba(130, 230, 255, 0.26) 50%, transparent 57%);
    background-size: auto;
    opacity: 0.62;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--wind .dofemon-card-art::after {
    bottom: 40px;
    height: 34px;
    background:
        linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent),
        radial-gradient(ellipse at 50% 100%, rgba(225, 251, 255, 0.34), transparent 68%);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--wind .dofemon-card-monster-img {
    filter:
        drop-shadow(0 16px 16px rgba(0, 0, 0, 0.5))
        drop-shadow(0 0 18px rgba(158, 232, 255, 0.44));
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--wind .dofemon-card-art-stats > div {
    border-color: color-mix(in srgb, var(--stat-color) 68%, rgba(255, 255, 255, 0.2));
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.19), color-mix(in srgb, var(--stat-color) 15%, transparent) 38%, rgba(4, 13, 23, 0.88)),
        rgba(8, 18, 28, 0.86);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--wind .dofemon-card-body {
    background:
        linear-gradient(180deg, rgba(195, 239, 255, 0.08), rgba(5, 16, 28, 0.08)),
        rgba(8, 21, 35, 0.82);
    border-color: rgba(185, 233, 255, 0.2);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--wind .dofemon-card-passive {
    box-shadow: inset 0 0 18px rgba(103, 195, 255, 0.05);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--wind .dofemon-card-spell {
    border-color: color-mix(in srgb, var(--spell-type-color) 44%, rgba(255, 255, 255, 0.08));
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--wind .dofemon-card-spell:hover,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--wind .dofemon-card-spell.is-selected {
    border-color: color-mix(in srgb, var(--spell-type-color) 82%, white 18%);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--wind .dofemon-card-spell-detail {
    border-color: rgba(188, 233, 255, 0.18);
    box-shadow: inset 0 0 18px rgba(102, 203, 255, 0.05);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--fire {
    --dofemon-card-color: #ff7045;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--fire .dofemon-card-frame {
    background:
        radial-gradient(circle at 28% 16%, rgba(255, 184, 77, 0.34), transparent 26%),
        radial-gradient(circle at 82% 24%, rgba(255, 56, 30, 0.22), transparent 30%),
        linear-gradient(165deg, #663022, #1d1820 52%, #0d1017);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--fire .dofemon-card-art {
    background:
        radial-gradient(ellipse at 50% 52%, rgba(255, 139, 40, 0.34), transparent 30%),
        linear-gradient(180deg, #5f2a27 0%, #301a20 48%, #130f16 100%);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--fire .dofemon-card-art::before {
    background:
        radial-gradient(circle at 20% 72%, rgba(255, 84, 25, 0.42), transparent 12%),
        radial-gradient(circle at 80% 68%, rgba(255, 188, 71, 0.3), transparent 10%),
        linear-gradient(0deg, rgba(255, 88, 31, 0.36), transparent 44%);
    opacity: 0.82;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-detail-card .dofemon-card-frame {
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.22), transparent 18%),
        radial-gradient(circle at 20% 14%, rgba(255, 255, 255, 0.28), transparent 22%),
        radial-gradient(circle at 82% 18%, var(--dofemon-theme-soft), transparent 32%),
        radial-gradient(circle at 50% 100%, color-mix(in srgb, var(--dofemon-theme-color) 22%, transparent), transparent 38%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 16px),
        linear-gradient(165deg, var(--dofemon-frame-a), var(--dofemon-frame-b) 52%, var(--dofemon-frame-c));
    border-color: color-mix(in srgb, var(--dofemon-theme-bright) 78%, white 22%);
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.12),
        inset 0 -28px 45px rgba(0, 0, 0, 0.34),
        0 0 34px color-mix(in srgb, var(--dofemon-theme-color) 28%, transparent),
        0 18px 38px rgba(0, 0, 0, 0.4);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-detail-card .dofemon-card-frame::before {
    border-color: color-mix(in srgb, var(--dofemon-theme-bright) 24%, transparent);
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--dofemon-theme-color) 14%, transparent),
        inset 0 0 22px color-mix(in srgb, var(--dofemon-theme-color) 10%, transparent);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-detail-card .dofemon-card-frame::after {
    background:
        linear-gradient(112deg, transparent 0 28%, rgba(255, 255, 255, 0.17) 39%, transparent 51%),
        radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.22), transparent 18%),
        radial-gradient(circle at 12% 88%, color-mix(in srgb, var(--dofemon-theme-color) 22%, transparent), transparent 18%);
    opacity: 0.5;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-detail-card .dofemon-card-top::before,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-detail-card .dofemon-card-footer::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background:
        radial-gradient(circle, color-mix(in srgb, var(--dofemon-theme-bright) 74%, white 26%) 0 24%, transparent 26% 100%),
        color-mix(in srgb, var(--dofemon-theme-color) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--dofemon-theme-bright) 34%, transparent);
    box-shadow: 0 0 10px color-mix(in srgb, var(--dofemon-theme-color) 28%, transparent);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-detail-card .dofemon-card-top::before {
    left: -2px;
    top: -25px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-detail-card .dofemon-card-footer::before {
    right: 1px;
    bottom: 47px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-detail-card .dofemon-card-art {
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--dofemon-theme-color) 8%, transparent), rgba(5, 14, 26, 0.18)),
        radial-gradient(ellipse at 50% 44%, color-mix(in srgb, var(--dofemon-theme-bright) 44%, transparent), transparent 25%),
        radial-gradient(ellipse at 22% 24%, rgba(255, 255, 255, 0.45), transparent 15%),
        var(--dofemon-card-bg-url),
        linear-gradient(145deg, var(--dofemon-frame-a) 0%, var(--dofemon-frame-b) 46%, var(--dofemon-frame-c) 100%);
    background-size: cover;
    background-position: var(--dofemon-card-art-position);
    border-color: color-mix(in srgb, var(--dofemon-theme-bright) 58%, transparent);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.14),
        inset 0 -46px 52px rgba(6, 20, 36, 0.56),
        0 0 18px color-mix(in srgb, var(--dofemon-theme-color) 18%, transparent);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-detail-card .dofemon-card-art::before {
    background:
        repeating-radial-gradient(ellipse at 50% 48%, transparent 0 24px, rgba(255, 255, 255, 0.16) 25px 27px, transparent 28px 44px);
    background-size: auto;
    opacity: 0.62;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-detail-card .dofemon-card-art::after {
    content: none;
    bottom: 40px;
    height: 34px;
    background: none;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-detail-card .dofemon-card-monster-img {
    filter:
        drop-shadow(0 16px 16px rgba(0, 0, 0, 0.5))
        drop-shadow(0 0 18px color-mix(in srgb, var(--dofemon-theme-color) 42%, transparent));
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-detail-card .dofemon-card-art-stats > div {
    border-color: color-mix(in srgb, var(--stat-color) 68%, rgba(255, 255, 255, 0.2));
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.19), color-mix(in srgb, var(--stat-color) 15%, transparent) 38%, rgba(4, 13, 23, 0.88)),
        rgba(8, 18, 28, 0.86);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-detail-card .dofemon-card-body {
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--dofemon-theme-bright) 8%, transparent), rgba(5, 16, 28, 0.08)),
        color-mix(in srgb, var(--dofemon-frame-b) 58%, rgba(8, 18, 28, 0.82));
    border-color: color-mix(in srgb, var(--dofemon-theme-bright) 20%, transparent);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-detail-card .dofemon-card-passive {
    box-shadow: inset 0 0 18px color-mix(in srgb, var(--dofemon-theme-color) 5%, transparent);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-detail-card .dofemon-card-spell {
    border-color: color-mix(in srgb, var(--spell-type-color) 44%, rgba(255, 255, 255, 0.08));
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-detail-card .dofemon-card-spell:hover,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-detail-card .dofemon-card-spell.is-selected {
    border-color: color-mix(in srgb, var(--spell-type-color) 82%, white 18%);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-detail-card .dofemon-card-spell-detail {
    border-color: color-mix(in srgb, var(--dofemon-theme-bright) 18%, transparent);
    box-shadow: inset 0 0 18px color-mix(in srgb, var(--dofemon-theme-color) 5%, transparent);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--normal {
    --dofemon-theme-color: #c6ced6;
    --dofemon-theme-bright: #f4f7fb;
    --dofemon-frame-a: #596573;
    --dofemon-frame-b: #28313a;
    --dofemon-frame-c: #101820;
    --dofemon-card-bg-url: url("images/backgrounds/normal.png");
}

#hub-screen .hero-card-panel {
    position: relative;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

#hub-screen #inventory-panel,
#hub-screen #details-panel-container {
    background:
        linear-gradient(155deg, rgba(255, 255, 255, 0.08), transparent 22%),
        radial-gradient(circle at 24% 0%, rgba(126, 210, 132, 0.22), transparent 34%),
        linear-gradient(180deg, rgba(45, 82, 61, 0.96), rgba(24, 56, 41, 0.98));
    border-color: rgba(113, 190, 122, 0.68);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -22px 42px rgba(4, 22, 15, 0.26),
        0 14px 28px rgba(0, 0, 0, 0.34),
        0 0 22px rgba(78, 181, 97, 0.16);
}

#hub-screen #inventory-panel .section-title,
#hub-screen #details-panel-container .section-title {
    color: #ffd84a;
    border-bottom-color: rgba(203, 171, 84, 0.44);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.58), 0 0 10px rgba(255, 204, 66, 0.24);
}

#hub-screen .hero-gold-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 5px 0;
    padding: 6px 8px;
    border-radius: 6px;
    color: #ffd84a;
    font-size: 14px;
    font-weight: 900;
    text-align: center;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.1)),
        rgba(21, 42, 29, 0.86);
    border: 1px solid rgba(203, 171, 84, 0.42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 5px 10px rgba(0, 0, 0, 0.18);
}

#hub-screen #inventory-panel .inventory-tabs {
    gap: 7px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(204, 255, 194, 0.14);
    background:
        linear-gradient(180deg, rgba(75, 126, 103, 0.22), rgba(12, 34, 37, 0.18));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#hub-screen #inventory-panel .inventory-tab,
#hub-screen #inventory-panel #inventory-sort-container .sort-btn {
    min-height: 32px;
    border: 1px solid rgba(221, 255, 214, 0.24) !important;
    border-radius: 7px !important;
    background:
        linear-gradient(180deg, rgba(92, 150, 124, 0.64), rgba(24, 63, 62, 0.9)) !important;
    color: #f2ffe8 !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -10px 14px rgba(0, 0, 0, 0.18),
        0 5px 12px rgba(0, 0, 0, 0.22);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

#hub-screen #inventory-panel .inventory-tab:hover,
#hub-screen #inventory-panel #inventory-sort-container .sort-btn:hover {
    border-color: rgba(235, 255, 123, 0.74) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -10px 14px rgba(0, 0, 0, 0.16),
        0 7px 16px rgba(0, 0, 0, 0.25),
        0 0 16px rgba(216, 255, 133, 0.18);
}

#hub-screen #inventory-panel .inventory-tab.active,
#hub-screen #inventory-panel #inventory-sort-container .sort-btn.active {
    border-color: rgba(255, 243, 107, 0.86) !important;
    background:
        linear-gradient(180deg, rgba(211, 230, 105, 0.82), rgba(65, 117, 76, 0.94)) !important;
    color: #fffbe0 !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        inset 0 -10px 14px rgba(0, 0, 0, 0.16),
        0 0 0 2px rgba(255, 243, 107, 0.22),
        0 0 18px rgba(255, 243, 107, 0.32);
}

#hub-screen #inventory-panel .inv-grid {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.08)),
        rgba(17, 38, 27, 0.82);
    border: 1px solid rgba(120, 190, 128, 0.22);
}

#hub-screen #inventory-panel .item-box {
    background: rgba(35, 62, 47, 0.9);
    border-color: rgba(125, 182, 130, 0.42);
}

#hub-screen #details-panel {
    color: rgba(238, 249, 234, 0.88);
}

#hub-screen #details-panel > em {
    color: rgba(238, 249, 234, 0.78);
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-detail-card {
    width: min(100%, 330px);
    margin-top: 4px;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-detail-card .dofemon-card-frame {
    padding: 10px;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-card-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 38px;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-card-top--single {
    grid-template-columns: 1fr;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-card-name {
    justify-self: stretch;
    font-size: 12px;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-card-top--single .equipment-card-name {
    text-align: center;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-card-spell-name {
    justify-self: stretch;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
    color: color-mix(in srgb, var(--dofemon-theme-bright) 78%, white 22%);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-detail-card .equipment-card-art {
    height: 206px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--dofemon-theme-color) 12%, transparent), rgba(0, 0, 0, 0.16)),
        radial-gradient(circle at 50% 48%, color-mix(in srgb, var(--dofemon-theme-color) 18%, transparent), transparent 36%),
        var(--item-card-bg-url),
        linear-gradient(155deg, var(--dofemon-frame-a), var(--dofemon-frame-b) 52%, var(--dofemon-frame-c));
    background-size: cover;
    background-position: center;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-card-image {
    width: 132px;
    height: 132px;
    object-fit: contain;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-card-fallback {
    width: 132px;
    height: 132px;
    font-size: 58px;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-card-body {
    display: grid;
    gap: 8px;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-card-stat-list {
    display: grid;
    gap: 6px;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-card-stat-row {
    --equipment-stat-color: #c6ced6;
    min-height: 34px;
    display: grid;
    grid-template-columns: minmax(86px, 0.9fr) minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--equipment-stat-color) 18%, transparent), rgba(255, 255, 255, 0.03)),
        rgba(4, 12, 18, 0.66);
    border: 1px solid color-mix(in srgb, var(--equipment-stat-color) 38%, rgba(255, 255, 255, 0.1));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-card-stat-row--pm { --equipment-stat-color: #3ee37c; }
:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-card-stat-row--hp { --equipment-stat-color: #ff6078; }
:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-card-stat-row--force { --equipment-stat-color: #ffd447; }
:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-card-stat-row--init { --equipment-stat-color: #42a5ff; }

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-card-stat-row span {
    color: color-mix(in srgb, var(--equipment-stat-color) 60%, white 40%);
    font-size: 10px;
    font-weight: 1000;
    text-transform: uppercase;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-card-stat-row strong {
    justify-self: end;
    color: color-mix(in srgb, var(--equipment-stat-color) 82%, white 18%);
    font-size: 15px;
    line-height: 1;
    text-shadow: 0 0 8px color-mix(in srgb, var(--equipment-stat-color) 34%, transparent);
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-card-attack-title {
    margin-top: 2px;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-card-spells {
    grid-template-columns: 1fr;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-card-spell {
    cursor: default;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-card-spell-detail {
    min-height: 142px;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-card-rarity {
    display: flex;
    align-items: flex-end;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-card-rarity span {
    margin-left: 0;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .equipment-card-footer {
    grid-template-columns: 32px minmax(0, 1fr);
}

#hub-screen .hero-equipment-detail-action {
    width: min(100%, 330px);
    margin: 12px auto 0;
}

#hub-screen .hero-equipment-equip-btn,
#reward-calendar .calendar-continue {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}
#reward-calendar .calendar-continue { width: min(100%, 330px); margin: 12px auto 0; text-align: center; }

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .consumable-detail-card {
    width: min(100%, 330px);
    margin-top: 4px;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .consumable-detail-card .dofemon-card-frame {
    padding: 10px;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .consumable-card-top {
    grid-template-columns: minmax(66px, 0.45fr) minmax(0, 1fr);
    min-height: 38px;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .consumable-card-quantity {
    justify-self: stretch;
    color: color-mix(in srgb, var(--dofemon-theme-bright) 74%, white 26%);
    font-size: 13px;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .consumable-card-name {
    justify-self: stretch;
    font-size: 12px;
    text-align: right;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .consumable-detail-card .consumable-card-art {
    height: 206px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--dofemon-theme-color) 12%, transparent), rgba(0, 0, 0, 0.16)),
        radial-gradient(circle at 50% 48%, color-mix(in srgb, var(--dofemon-theme-color) 18%, transparent), transparent 36%),
        var(--item-card-bg-url),
        linear-gradient(155deg, var(--dofemon-frame-a), var(--dofemon-frame-b) 52%, var(--dofemon-frame-c));
    background-size: cover;
    background-position: center;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .consumable-card-image {
    width: 136px;
    height: 136px;
    object-fit: contain;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .consumable-card-fallback {
    width: 136px;
    height: 136px;
    font-size: 58px;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .consumable-card-body {
    min-height: 176px;
    display: grid;
    align-content: start;
    gap: 10px;
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .consumable-card-description {
    min-height: 112px;
    padding: 10px 11px;
    border-radius: 8px;
    color: rgba(240, 248, 240, 0.9);
    font-size: 12px;
    line-height: 1.42;
    white-space: pre-line;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--dofemon-theme-bright) 7%, transparent), rgba(0, 0, 0, 0.08)),
        rgba(2, 12, 8, 0.36);
    border: 1px solid color-mix(in srgb, var(--dofemon-theme-bright) 18%, rgba(255, 255, 255, 0.1));
}

:is(#hub-screen, #shop-screen, .hero-item-detail-scope) .consumable-card-use-btn {
    width: 100%;
    padding: 10px;
    border-color: color-mix(in srgb, var(--dofemon-theme-bright) 64%, #1f7d42 36%);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(0, 0, 0, 0.12)),
        color-mix(in srgb, var(--dofemon-theme-color) 72%, #1f7d42 28%);
    color: #ffffff;
    font-weight: 900;
    cursor: pointer;
    text-transform: uppercase;
}

#hub-screen .hero-detail-card {
    width: min(100%, 430px);
    --dofemon-card-bg-url: url("images/backgrounds/hero_village.png");
    --dofemon-card-mobile-bg-url: url("images/backgrounds/hero_village_mobile.jpg");
    --dofemon-card-art-position: center center;
}

#hub-screen .hero-card-art {
    height: 304px;
    overflow: visible;
}

#hub-screen .hero-card-art-stats {
    bottom: 10px;
}

#hub-screen .hero-card-art::before {
    border-radius: 10px;
}

#hub-screen .hero-card-art .char-avatar-container {
    position: relative;
    inset: auto;
    width: 126px;
    height: 190px;
    left: auto !important;
    transform: none;
    transform: none !important;
    z-index: 3;
    cursor: pointer;
}

#hub-screen .hero-card-art .char-avatar {
    width: 126px;
    height: 190px;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#hub-screen .hero-card-skin {
    width: 126px;
    height: 190px;
    object-fit: contain;
    display: none;
}

#hub-screen .hero-card-fallback {
    width: 126px;
    height: 190px;
    font-size: 64px;
}

#hub-screen .hero-equipment-slot {
    width: 58px;
    height: 54px;
    z-index: 5;
    flex-direction: column;
    gap: 2px;
    border-radius: 8px;
    border: 1px dashed color-mix(in srgb, var(--dofemon-theme-bright) 62%, transparent);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.18)),
        rgba(8, 18, 28, 0.86);
    color: rgba(247, 251, 255, 0.94);
    font-size: 20px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 16px rgba(0, 0, 0, 0.28);
}

#hub-screen .hero-equipment-slot span {
    max-width: 100%;
    overflow: hidden;
    color: rgba(245, 250, 255, 0.9);
    font-size: 8px;
    font-weight: 900;
    line-height: 1;
    text-overflow: ellipsis;
    text-transform: uppercase;
}

#hub-screen .hero-equipment-slot.filled {
    border-style: solid;
    background:
        radial-gradient(circle at 50% 24%, rgba(255, 255, 255, 0.16), transparent 36%),
        rgba(14, 28, 38, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 14px rgba(243, 156, 18, 0.26);
}

#hub-screen .hero-equipment-slot--weapon {
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
}

#hub-screen .hero-equipment-slot--head { top: 42px; left: 16px; }
#hub-screen .hero-equipment-slot--body { top: 116px; left: 16px; }
#hub-screen .hero-equipment-slot--finger { top: 190px; bottom: auto; left: 16px; }
#hub-screen .hero-equipment-slot--neck { top: 42px; right: 16px; }
#hub-screen .hero-equipment-slot--hands { top: 116px; right: 16px; }
#hub-screen .hero-equipment-slot--feet { top: 190px; bottom: auto; right: 16px; }

#hub-screen .hero-card-body {
    gap: 8px;
}

#hub-screen .hero-xp-area {
    margin-top: 0;
}

#hub-screen .hero-skill-summary {
    width: 100%;
    min-height: 32px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--dofemon-theme-bright) 24%, transparent);
    background: rgba(0, 0, 0, 0.24);
    color: #f7fff2;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

#hub-screen .hero-skill-summary span {
    color: #dfff6c;
}

#hub-screen .hero-card-spells {
    grid-template-columns: 1fr 1fr;
}

#hub-screen .hero-card-spells .dofemon-card-spell.is-empty {
    opacity: 0.42;
    cursor: default;
}

#hub-screen .hero-skill-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.72);
}

#hub-screen .hero-skill-modal-card {
    width: min(92vw, 360px);
    border-radius: 8px;
    border: 1px solid rgba(227, 255, 147, 0.42);
    background: linear-gradient(180deg, rgba(75, 126, 103, 0.96), rgba(23, 55, 58, 0.98));
    box-shadow: inset 0 0 34px rgba(197, 255, 199, 0.08), 0 18px 45px rgba(0, 0, 0, 0.46);
    color: #f2ffe8;
}

#hub-screen .hero-skill-modal-close {
    width: 100%;
    min-height: 38px;
    border: 0;
    border-bottom: 1px solid rgba(221, 255, 214, 0.22);
    background: rgba(231, 76, 60, 0.92);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

#hub-screen .hero-skill-panel {
    padding: 18px;
}

#hub-screen .hero-skill-panel h3 {
    margin: 0 0 12px;
    color: #f2ffe8;
    text-align: center;
    text-transform: uppercase;
}

#hub-screen .hero-skill-count {
    margin-bottom: 14px;
    color: rgba(242, 255, 232, 0.78);
    font-size: 14px;
    font-weight: 900;
    text-align: center;
}

#hub-screen .hero-skill-count span {
    color: #dfff6c;
}

#hub-screen .hero-skill-rows {
    display: grid;
    gap: 8px;
}

#hub-screen .hero-skill-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(221, 255, 214, 0.14);
    font-size: 13px;
    font-weight: 900;
}

#hub-screen .hero-skill-row > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

#hub-screen .hero-skill-row span[id^="skill-"] {
    min-width: 30px;
    text-align: center;
}

#hub-screen .hero-skill-row .skill-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 6px;
}

#hub-screen .hero-skill-confirm {
    width: 100%;
    min-height: 38px;
    margin-top: 14px;
    border: 0;
    border-radius: 8px;
    background: #2ecc71;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--fire {
    --dofemon-theme-color: #ff7045;
    --dofemon-theme-bright: #ffb347;
    --dofemon-frame-a: #6f2f20;
    --dofemon-frame-b: #28131a;
    --dofemon-frame-c: #0d1017;
    --dofemon-card-bg-url: url("images/backgrounds/fire.png");
    --dofemon-card-art-position: center 48%;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--water {
    --dofemon-theme-color: #42c6ff;
    --dofemon-theme-bright: #a6f4ff;
    --dofemon-frame-a: #1f667b;
    --dofemon-frame-b: #113145;
    --dofemon-frame-c: #061423;
    --dofemon-card-bg-url: url("images/backgrounds/water.png");
    --dofemon-card-art-position: center 48%;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--grass {
    --dofemon-theme-color: #5fda75;
    --dofemon-theme-bright: #dbf7a2;
    --dofemon-frame-a: #345d36;
    --dofemon-frame-b: #17391f;
    --dofemon-frame-c: #07150c;
    --dofemon-card-bg-url: url("images/backgrounds/grass.png");
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--electric {
    --dofemon-theme-color: #ffe04f;
    --dofemon-theme-bright: #7df8ff;
    --dofemon-frame-a: #6b5c1c;
    --dofemon-frame-b: #252346;
    --dofemon-frame-c: #0e1022;
    --dofemon-card-bg-url: url("images/backgrounds/electric.png");
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--wind {
    --dofemon-theme-color: #9bdcff;
    --dofemon-theme-bright: #e2f9ff;
    --dofemon-frame-a: #5b748e;
    --dofemon-frame-b: #122a42;
    --dofemon-frame-c: #07121f;
    --dofemon-card-bg-url: url("images/backgrounds/wind.png");
    --dofemon-card-art-position: center 47%;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--ground {
    --dofemon-theme-color: #c79a62;
    --dofemon-theme-bright: #f1c985;
    --dofemon-frame-a: #6b4a2c;
    --dofemon-frame-b: #2f241b;
    --dofemon-frame-c: #120d08;
    --dofemon-card-bg-url: url("images/backgrounds/ground.png");
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--psychic {
    --dofemon-theme-color: #c77dff;
    --dofemon-theme-bright: #ffb8ff;
    --dofemon-frame-a: #53317a;
    --dofemon-frame-b: #251c45;
    --dofemon-frame-c: #10091d;
    --dofemon-card-bg-url: url("images/backgrounds/psychic.png");
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--dark {
    --dofemon-theme-color: #8d7bff;
    --dofemon-theme-bright: #d2c8ff;
    --dofemon-frame-a: #2a2443;
    --dofemon-frame-b: #11101f;
    --dofemon-frame-c: #07070e;
    --dofemon-card-bg-url: url("images/backgrounds/dark.png");
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--light {
    --dofemon-theme-color: #ffe9a6;
    --dofemon-theme-bright: #ffffff;
    --dofemon-frame-a: #79672a;
    --dofemon-frame-b: #463b18;
    --dofemon-frame-c: #171307;
    --dofemon-card-bg-url: url("images/backgrounds/light.png");
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--steel {
    --dofemon-theme-color: #b9c7d4;
    --dofemon-theme-bright: #74f1ff;
    --dofemon-frame-a: #5c6872;
    --dofemon-frame-b: #28333b;
    --dofemon-frame-c: #0b1116;
    --dofemon-card-bg-url: url("images/backgrounds/steel.png");
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card--dragon {
    --dofemon-theme-color: #ff9d4d;
    --dofemon-theme-bright: #d8ff7a;
    --dofemon-frame-a: #664329;
    --dofemon-frame-b: #2b2131;
    --dofemon-frame-c: #120b13;
    --dofemon-card-bg-url: url("images/backgrounds/dragon.png");
}

@media (max-width: 900px) {
    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-layout {
        width: min(100%, calc(100vw - 20px));
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    #dofedex-screen .hub-columns {
        width: min(100%, calc(100vw - 20px));
        flex-direction: column;
        align-items: center;
        gap: 14px;
    }

    #dofedex-screen #dofedex-main-panel {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 0;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-team-panel,
    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-details-panel {
        width: 100% !important;
        max-height: none;
        min-width: 0;
        position: relative;
        top: auto;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-team-panel {
        min-height: 0;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-monster-list {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 12px 8px 16px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-team-card {
        min-height: 108px;
        padding-left: 98px;
    }

    #dofemage-screen .dofemage-details-panel {
        display: none;
    }

    #dofemage-screen.team-mobile-detail-open .dofemage-details-panel {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 100050;
        width: 100vw !important;
        max-width: none !important;
        height: 100dvh;
        max-height: none;
        min-height: 100dvh;
        padding: 0;
        border: 0;
        border-radius: 0;
        background:
            radial-gradient(circle at 50% 12%, rgba(214, 255, 151, 0.2), transparent 34%),
            linear-gradient(180deg, rgba(7, 19, 24, 0.97), rgba(18, 46, 48, 0.98));
        overflow: hidden;
        box-shadow: none;
    }

    #dofemage-screen.team-mobile-detail-open .dofemage-details-title {
        display: none;
    }

    #dofemage-screen.team-mobile-detail-open #team-details-panel {
        width: 100%;
        height: 100%;
        min-height: 0;
        padding: 58px 14px 24px;
        overflow-y: auto;
        box-sizing: border-box;
        scrollbar-width: thin;
        scrollbar-color: rgba(222, 255, 135, 0.78) rgba(11, 32, 35, 0.58);
    }

    #dofemage-screen.team-mobile-detail-open .team-mobile-detail-close {
        position: fixed;
        top: max(12px, env(safe-area-inset-top));
        right: max(12px, env(safe-area-inset-right));
        z-index: 100060;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid #ffb0b0;
        border-radius: 50%;
        background: rgba(174, 22, 22, 0.94);
        color: #fff;
        font-size: 28px;
        font-weight: 900;
        line-height: 1;
        cursor: pointer;
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42), 0 0 16px rgba(255, 68, 68, 0.28);
    }

    #dofemage-screen.team-mobile-detail-open .dofemon-detail-card {
        width: min(100%, 430px);
        /* Pas de filter sur mobile : un drop-shadow force le rendu offscreen GPU de toute
           la carte (mémoire WebKit) ; l'ombre externe vient du box-shadow du frame. */
        filter: none;
    }

    #dofemage-screen.team-mobile-detail-open .dofemon-detail-card .dofemon-card-frame {
        background:
            linear-gradient(150deg, rgba(255, 255, 255, 0.16), transparent 20%),
            radial-gradient(circle at 82% 18%, var(--dofemon-theme-soft), transparent 30%),
            linear-gradient(165deg, var(--dofemon-frame-a), var(--dofemon-frame-b) 52%, var(--dofemon-frame-c));
        box-shadow:
            inset 0 0 0 1px rgba(255, 255, 255, 0.1),
            inset 0 -18px 30px rgba(0, 0, 0, 0.28),
            0 12px 24px rgba(0, 0, 0, 0.34);
    }

    #dofemage-screen.team-mobile-detail-open .dofemon-detail-card .dofemon-card-frame::after {
        mix-blend-mode: normal;
        opacity: 0.22;
    }

    #dofemage-screen.team-mobile-detail-open .dofemon-detail-card .dofemon-card-art {
        background:
            linear-gradient(180deg, color-mix(in srgb, var(--dofemon-theme-color) 7%, transparent), rgba(5, 14, 26, 0.16)),
            radial-gradient(ellipse at 50% 44%, color-mix(in srgb, var(--dofemon-theme-bright) 28%, transparent), transparent 28%),
            var(--dofemon-card-mobile-bg-url, var(--dofemon-card-bg-url)),
            linear-gradient(145deg, var(--dofemon-frame-a) 0%, var(--dofemon-frame-b) 46%, var(--dofemon-frame-c) 100%);
        background-size: cover;
        background-position: var(--dofemon-card-art-position);
        box-shadow:
            inset 0 0 0 1px rgba(255, 255, 255, 0.12),
            inset 0 -28px 36px rgba(6, 20, 36, 0.48);
    }

    #dofemage-screen.team-mobile-detail-open .dofemon-detail-card .dofemon-card-art::before {
        opacity: 0.22;
    }

    #dofemage-screen.team-mobile-detail-open .dofemon-card-art-glow {
        filter: none;
        opacity: 0.55;
    }

    #dofemage-screen.team-mobile-detail-open .dofemon-detail-card .dofemon-card-monster-img {
        filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.48));
    }

    #dofemage-screen.team-mobile-detail-open .dofemon-card-top-badge,
    #dofemage-screen.team-mobile-detail-open .dofemon-card-name,
    #dofemage-screen.team-mobile-detail-open .dofemon-card-art-stats > div,
    #dofemage-screen.team-mobile-detail-open .dofemon-card-spell,
    #dofemage-screen.team-mobile-detail-open .dofemon-card-spell-detail {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 8px rgba(0, 0, 0, 0.18);
    }

    #bestiary-screen .bestiary-details-panel {
        display: none;
    }

    #bestiary-screen.bestiary-mobile-detail-open .bestiary-details-panel {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 100050;
        width: 100vw !important;
        max-width: none !important;
        height: 100dvh;
        max-height: none;
        min-height: 100dvh;
        padding: 0;
        border: 0;
        border-radius: 0;
        background:
            radial-gradient(circle at 50% 12%, rgba(214, 255, 151, 0.2), transparent 34%),
            linear-gradient(180deg, rgba(7, 19, 24, 0.97), rgba(18, 46, 48, 0.98));
        overflow: hidden;
        box-shadow: none;
    }

    #bestiary-screen.bestiary-mobile-detail-open .dofemage-details-title {
        display: none;
    }

    #bestiary-screen.bestiary-mobile-detail-open #bestiary-details-panel {
        width: 100%;
        height: 100%;
        min-height: 0;
        padding: 58px 14px 24px;
        overflow-y: auto;
        box-sizing: border-box;
        scrollbar-width: thin;
        scrollbar-color: rgba(222, 255, 135, 0.78) rgba(11, 32, 35, 0.58);
    }

    #bestiary-screen.bestiary-mobile-detail-open .bestiary-mobile-detail-close {
        position: fixed;
        top: max(12px, env(safe-area-inset-top));
        right: max(12px, env(safe-area-inset-right));
        z-index: 100060;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid #ffb0b0;
        border-radius: 50%;
        background: rgba(174, 22, 22, 0.94);
        color: #fff;
        font-size: 28px;
        font-weight: 900;
        line-height: 1;
        cursor: pointer;
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42), 0 0 16px rgba(255, 68, 68, 0.28);
    }

    :is(#bestiary-screen.bestiary-mobile-detail-open, .bestiary-panorama) .dofemon-detail-card {
        width: min(100%, 430px);
        /* Pas de filter sur mobile (mémoire GPU WebKit) : ombre déjà portée par le frame. */
        filter: none;
    }

    :is(#bestiary-screen.bestiary-mobile-detail-open, .bestiary-panorama) .dofemon-detail-card .dofemon-card-frame {
        background:
            linear-gradient(150deg, rgba(255, 255, 255, 0.16), transparent 20%),
            radial-gradient(circle at 82% 18%, var(--dofemon-theme-soft), transparent 30%),
            linear-gradient(165deg, var(--dofemon-frame-a), var(--dofemon-frame-b) 52%, var(--dofemon-frame-c));
        box-shadow:
            inset 0 0 0 1px rgba(255, 255, 255, 0.1),
            inset 0 -18px 30px rgba(0, 0, 0, 0.28),
            0 12px 24px rgba(0, 0, 0, 0.34);
    }

    :is(#bestiary-screen.bestiary-mobile-detail-open, .bestiary-panorama) .dofemon-detail-card .dofemon-card-frame::after {
        mix-blend-mode: normal;
        opacity: 0.22;
    }

    :is(#bestiary-screen.bestiary-mobile-detail-open, .bestiary-panorama) .dofemon-detail-card .dofemon-card-art {
        background:
            linear-gradient(180deg, color-mix(in srgb, var(--dofemon-theme-color) 7%, transparent), rgba(5, 14, 26, 0.16)),
            radial-gradient(ellipse at 50% 44%, color-mix(in srgb, var(--dofemon-theme-bright) 28%, transparent), transparent 28%),
            var(--dofemon-card-mobile-bg-url, var(--dofemon-card-bg-url)),
            linear-gradient(145deg, var(--dofemon-frame-a) 0%, var(--dofemon-frame-b) 46%, var(--dofemon-frame-c) 100%);
        background-size: cover;
        background-position: var(--dofemon-card-art-position);
        box-shadow:
            inset 0 0 0 1px rgba(255, 255, 255, 0.12),
            inset 0 -28px 36px rgba(6, 20, 36, 0.48);
    }

    :is(#bestiary-screen.bestiary-mobile-detail-open, .bestiary-panorama) .dofemon-detail-card .dofemon-card-art::before {
        opacity: 0.22;
    }

    :is(#bestiary-screen.bestiary-mobile-detail-open, .bestiary-panorama) .dofemon-card-art-glow {
        filter: none;
        opacity: 0.55;
    }

    :is(#bestiary-screen.bestiary-mobile-detail-open, .bestiary-panorama) .dofemon-detail-card .dofemon-card-monster-img {
        filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.48));
    }

    :is(#bestiary-screen.bestiary-mobile-detail-open, .bestiary-panorama) .dofemon-card-top-badge,
    :is(#bestiary-screen.bestiary-mobile-detail-open, .bestiary-panorama) .dofemon-card-name,
    :is(#bestiary-screen.bestiary-mobile-detail-open, .bestiary-panorama) .dofemon-card-art-stats > div,
    :is(#bestiary-screen.bestiary-mobile-detail-open, .bestiary-panorama) .dofemon-card-spell,
    :is(#bestiary-screen.bestiary-mobile-detail-open, .bestiary-panorama) .dofemon-card-spell-detail {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 8px rgba(0, 0, 0, 0.18);
    }

    #hub-screen #details-panel-container {
        display: none;
    }

    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) #details-panel-container {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 100050;
        width: 100vw !important;
        max-width: none !important;
        height: 100dvh;
        max-height: none;
        min-height: 100dvh;
        padding: 0;
        border: 0;
        border-radius: 0;
        background:
            radial-gradient(circle at 50% 12%, rgba(214, 255, 151, 0.2), transparent 34%),
            linear-gradient(180deg, rgba(7, 19, 24, 0.97), rgba(18, 46, 48, 0.98));
        overflow: hidden;
        box-shadow: none;
    }

    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) #details-title {
        display: none;
    }

    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) #details-panel {
        width: 100%;
        height: 100%;
        min-height: 0;
        padding: 58px 14px 24px;
        overflow-y: auto;
        box-sizing: border-box;
        scrollbar-width: thin;
        scrollbar-color: rgba(222, 255, 135, 0.78) rgba(11, 32, 35, 0.58);
    }

    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) .hero-item-mobile-detail-close {
        position: fixed;
        top: max(12px, env(safe-area-inset-top));
        right: max(12px, env(safe-area-inset-right));
        z-index: 100060;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid #ffb0b0;
        border-radius: 50%;
        background: rgba(174, 22, 22, 0.94);
        color: #fff;
        font-size: 28px;
        font-weight: 900;
        line-height: 1;
        cursor: pointer;
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42), 0 0 16px rgba(255, 68, 68, 0.28);
    }

    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) .equipment-detail-card,
    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) .consumable-detail-card {
        width: min(100%, 430px);
        margin: 0 auto;
        /* Pas de filter sur mobile (mémoire GPU WebKit) : ombre déjà portée par le frame. */
        filter: none;
    }

    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) .hero-equipment-detail-action {
        width: min(100%, 430px);
    }

    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) .equipment-detail-card .dofemon-card-frame,
    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) .consumable-detail-card .dofemon-card-frame {
        background:
            linear-gradient(150deg, rgba(255, 255, 255, 0.15), transparent 20%),
            radial-gradient(circle at 82% 18%, var(--dofemon-theme-soft), transparent 30%),
            linear-gradient(165deg, var(--dofemon-frame-a), var(--dofemon-frame-b) 52%, var(--dofemon-frame-c));
        box-shadow:
            inset 0 0 0 1px rgba(255, 255, 255, 0.1),
            inset 0 -18px 30px rgba(0, 0, 0, 0.28),
            0 12px 24px rgba(0, 0, 0, 0.34);
    }

    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) .equipment-detail-card .dofemon-card-frame::after,
    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) .consumable-detail-card .dofemon-card-frame::after {
        mix-blend-mode: normal;
        opacity: 0.2;
    }

    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) .equipment-detail-card .equipment-card-art,
    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) .consumable-detail-card .consumable-card-art {
        background:
            linear-gradient(180deg, color-mix(in srgb, var(--dofemon-theme-color) 7%, transparent), rgba(5, 14, 26, 0.16)),
            radial-gradient(ellipse at 50% 44%, color-mix(in srgb, var(--dofemon-theme-bright) 24%, transparent), transparent 28%),
            var(--item-card-mobile-bg-url, var(--item-card-bg-url)),
            linear-gradient(145deg, var(--dofemon-frame-a) 0%, var(--dofemon-frame-b) 46%, var(--dofemon-frame-c) 100%);
        background-size: cover;
        background-position: center;
        box-shadow:
            inset 0 0 0 1px rgba(255, 255, 255, 0.12),
            inset 0 -28px 36px rgba(6, 20, 36, 0.48);
    }

    #hub-screen .hero-detail-card {
        /* Pas de filter sur mobile (mémoire GPU WebKit) : ombre déjà portée par le frame. */
        filter: none;
    }

    #hub-screen .hero-detail-card .dofemon-card-frame {
        background:
            linear-gradient(150deg, rgba(255, 255, 255, 0.15), transparent 20%),
            radial-gradient(circle at 82% 18%, var(--dofemon-theme-soft), transparent 30%),
            linear-gradient(165deg, var(--dofemon-frame-a), var(--dofemon-frame-b) 52%, var(--dofemon-frame-c));
        box-shadow:
            inset 0 0 0 1px rgba(255, 255, 255, 0.1),
            inset 0 -18px 30px rgba(0, 0, 0, 0.28),
            0 12px 24px rgba(0, 0, 0, 0.32);
    }

    #hub-screen .hero-detail-card .dofemon-card-frame::after {
        mix-blend-mode: normal;
        opacity: 0.2;
    }

    #hub-screen .hero-detail-card .hero-card-art {
        background:
            linear-gradient(180deg, color-mix(in srgb, var(--dofemon-theme-color) 7%, transparent), rgba(5, 14, 26, 0.16)),
            radial-gradient(ellipse at 50% 44%, color-mix(in srgb, var(--dofemon-theme-bright) 24%, transparent), transparent 28%),
            var(--dofemon-card-mobile-bg-url, var(--dofemon-card-bg-url)),
            linear-gradient(145deg, var(--dofemon-frame-a) 0%, var(--dofemon-frame-b) 46%, var(--dofemon-frame-c) 100%);
        background-size: cover;
        background-position: var(--dofemon-card-art-position);
        box-shadow:
            inset 0 0 0 1px rgba(255, 255, 255, 0.12),
            inset 0 -28px 36px rgba(6, 20, 36, 0.48);
    }

    #hub-screen .hero-detail-card .dofemon-card-art::before {
        opacity: 0.18;
    }

    #hub-screen .hero-detail-card .dofemon-card-art-glow {
        filter: none;
        opacity: 0.45;
    }

    #hub-screen .hero-detail-card .dofemon-card-monster-img {
        filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.44));
    }

    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) .equipment-detail-card .dofemon-card-art::before,
    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) .consumable-detail-card .dofemon-card-art::before {
        opacity: 0.22;
    }

    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) .dofemon-card-art-glow {
        filter: none;
        opacity: 0.5;
    }

    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) .equipment-detail-card .dofemon-card-monster-img,
    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) .consumable-detail-card .dofemon-card-monster-img {
        filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.46));
    }

    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) .dofemon-card-top-badge,
    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) .dofemon-card-name,
    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) .equipment-card-stat-row,
    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) .dofemon-card-spell,
    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) .dofemon-card-spell-detail,
    :is(#hub-screen.hero-item-mobile-detail-open, .hero-item-detail-scope) .consumable-card-description {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 8px rgba(0, 0, 0, 0.18);
    }

    #dofedex-screen #dofedex-details-panel-container {
        display: none !important;
    }

    #dofedex-screen.dofedex-mobile-detail-open #dofedex-details-panel-container {
        display: flex !important;
        position: fixed !important;
        inset: 0;
        z-index: 100050;
        width: 100vw !important;
        max-width: none !important;
        height: 100dvh;
        max-height: none !important;
        min-height: 100dvh;
        padding: 0;
        border: 0;
        border-radius: 0;
        background:
            radial-gradient(circle at 50% 12%, rgba(80, 226, 146, 0.18), transparent 34%),
            linear-gradient(180deg, rgba(7, 19, 24, 0.97), rgba(18, 46, 48, 0.98));
        overflow: hidden;
        box-shadow: none;
    }

    #dofedex-screen.dofedex-mobile-detail-open #dofedex-details-title {
        display: none;
    }

    #dofedex-screen.dofedex-mobile-detail-open #dofedex-details-panel {
        width: 100%;
        height: 100%;
        min-height: 0;
        padding: 58px 14px 24px !important;
        overflow-y: auto;
        box-sizing: border-box;
        scrollbar-width: thin;
        scrollbar-color: rgba(222, 255, 135, 0.78) rgba(11, 32, 35, 0.58);
    }

    #dofedex-screen.dofedex-mobile-detail-open .dofedex-mobile-detail-close {
        position: fixed;
        top: max(12px, env(safe-area-inset-top));
        right: max(12px, env(safe-area-inset-right));
        z-index: 100060;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid #ffb0b0;
        border-radius: 50%;
        background: rgba(174, 22, 22, 0.94);
        color: #fff;
        font-size: 28px;
        font-weight: 900;
        line-height: 1;
        cursor: pointer;
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42), 0 0 16px rgba(255, 68, 68, 0.28);
    }

    #dofedex-screen.dofedex-mobile-detail-open .dofemon-detail-card {
        width: min(100%, 430px);
        /* Pas de filter sur mobile (mémoire GPU WebKit) : ombre déjà portée par le frame. */
        filter: none;
    }

    #dofedex-screen .dofedex-entry {
        transition: none !important;
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.07),
            0 3px 7px rgba(0, 0, 0, 0.26) !important;
    }

    #dofedex-screen .dofedex-entry > div:first-child {
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.12),
            0 0 8px color-mix(in srgb, var(--dofedex-type-color, #ddffd6) 26%, transparent),
            0 3px 8px rgba(0, 0, 0, 0.24) !important;
    }

    #dofedex-screen .dofedex-entry img,
    #dofedex-screen .weakness-type-icon,
    #dofedex-screen .dofedex-achievement-img,
    #dofedex-screen .dofemon-card-spell-index--emblem img,
    #dofedex-screen .dofemon-card-spell-emblem--image img {
        filter: none !important;
    }

    #dofedex-screen .dofedex-achievement-badge,
    #dofedex-screen .weakness-cycle-card,
    #dofedex-screen .dofedex-spell-entry {
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.07),
            0 3px 8px rgba(0, 0, 0, 0.18) !important;
    }

    #dofedex-screen .dofedex-achievement-medallion {
        filter: none;
    }

    #dofedex-screen .weakness-type-node-halo {
        display: none;
    }

    #dofedex-screen.dofedex-mobile-detail-open .dofemon-detail-card .dofemon-card-frame {
        background:
            linear-gradient(150deg, rgba(255, 255, 255, 0.16), transparent 20%),
            radial-gradient(circle at 82% 18%, var(--dofemon-theme-soft), transparent 30%),
            linear-gradient(165deg, var(--dofemon-frame-a), var(--dofemon-frame-b) 52%, var(--dofemon-frame-c));
        box-shadow:
            inset 0 0 0 1px rgba(255, 255, 255, 0.1),
            inset 0 -18px 30px rgba(0, 0, 0, 0.28),
            0 12px 24px rgba(0, 0, 0, 0.34);
    }

    #dofedex-screen.dofedex-mobile-detail-open .dofemon-detail-card .dofemon-card-frame::after {
        mix-blend-mode: normal;
        opacity: 0.22;
    }

    #dofedex-screen.dofedex-mobile-detail-open .dofemon-detail-card .dofemon-card-art {
        background:
            linear-gradient(180deg, color-mix(in srgb, var(--dofemon-theme-color) 7%, transparent), rgba(5, 14, 26, 0.16)),
            radial-gradient(ellipse at 50% 44%, color-mix(in srgb, var(--dofemon-theme-bright) 28%, transparent), transparent 28%),
            var(--dofemon-card-mobile-bg-url, var(--dofemon-card-bg-url)),
            linear-gradient(145deg, var(--dofemon-frame-a) 0%, var(--dofemon-frame-b) 46%, var(--dofemon-frame-c) 100%);
        background-size: cover;
        background-position: var(--dofemon-card-art-position);
        box-shadow:
            inset 0 0 0 1px rgba(255, 255, 255, 0.12),
            inset 0 -28px 36px rgba(6, 20, 36, 0.48);
    }

    #dofedex-screen.dofedex-mobile-detail-open .dofemon-detail-card .dofemon-card-art::before {
        opacity: 0.22;
    }

    #dofedex-screen.dofedex-mobile-detail-open .dofemon-card-art-glow {
        filter: none;
        opacity: 0.55;
    }

    #dofedex-screen.dofedex-mobile-detail-open .dofemon-detail-card .dofemon-card-monster-img {
        filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.48));
    }

    #dofedex-screen.dofedex-mobile-detail-open .dofemon-card-top-badge,
    #dofedex-screen.dofedex-mobile-detail-open .dofemon-card-name,
    #dofedex-screen.dofedex-mobile-detail-open .dofemon-card-art-stats > div,
    #dofedex-screen.dofedex-mobile-detail-open .dofemon-card-spell,
    #dofedex-screen.dofedex-mobile-detail-open .dofemon-card-spell-detail,
    #dofedex-screen.dofedex-mobile-detail-open .dofemon-card-passive {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 8px rgba(0, 0, 0, 0.18);
    }
}

@media (max-width: 480px) {
    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-layout {
        width: calc(100vw - 10px);
        margin-top: 12px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-team-header {
        padding: 0 8px 10px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-title {
        font-size: 18px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-team-card {
        padding-right: 10px;
        padding-left: 88px;
        background:
            radial-gradient(circle at 41px 47px, rgba(154, 255, 190, 0.13), transparent 36px),
            linear-gradient(90deg, rgba(12, 34, 37, 0.24) 0 80px, rgba(77, 133, 108, 0.12) 80px, rgba(77, 133, 108, 0.03));
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-team-card::before {
        left: 92px;
        right: 18px;
        top: 34px;
        bottom: 25px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-team-card::after {
        left: 112px;
        right: 22px;
        bottom: 28px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-avatar-wrap {
        left: 12px;
        width: 64px;
        height: 88px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-avatar-wrap::before {
        left: -1px;
        top: 7px;
        width: 70px;
        height: 70px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-avatar-wrap::after {
        content: none;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-creature-sprite,
    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-creature-fallback {
        left: 34px;
        top: 42px;
        max-width: 72px;
        max-height: 72px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-creature-fallback {
        width: 64px;
        height: 64px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-team-card .squad-badge {
        top: 6px;
        left: 7px;
        width: 19px;
        height: 19px;
        font-size: 10px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-level-badge {
        bottom: 1px;
        min-width: 46px;
        padding: 2px 5px;
        font-size: 9px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-bars {
        max-width: none;
        gap: 5px;
        padding-left: 9px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-hp-bar {
        width: min(100%, 246px);
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-xp-bar {
        width: min(100%, 222px);
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemage-bar-label {
        font-size: 9px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spells {
        grid-template-columns: 1fr;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen, #dofemon-shop-screen, .hero-item-detail-scope, .bestiary-panorama) .dofemon-card-spell {
        grid-template-columns: 22px minmax(0, 1fr) 48px;
    }
}

#bestiary-screen.screen {
    width: min(96vw, 1560px) !important;
    max-width: min(96vw, 1560px) !important;
    box-sizing: border-box;
}

#bestiary-screen .bestiary-layout {
    width: min(100%, 1460px);
    max-width: calc(100% - 28px);
    grid-template-columns: minmax(330px, 0.9fr) minmax(390px, 1.16fr) minmax(360px, 0.86fr);
    gap: 18px;
}

#bestiary-screen .dofemage-monster-list,
#bestiary-screen .dofemage-details-panel {
    scrollbar-width: thin;
    scrollbar-color: rgba(222, 255, 135, 0.78) rgba(11, 32, 35, 0.58);
}

#bestiary-screen .dofemage-monster-list::-webkit-scrollbar,
#bestiary-screen .dofemage-details-panel::-webkit-scrollbar {
    width: 10px;
}

#bestiary-screen .dofemage-monster-list::-webkit-scrollbar-track,
#bestiary-screen .dofemage-details-panel::-webkit-scrollbar-track {
    border-radius: 999px;
    border: 1px solid rgba(204, 255, 194, 0.14);
    background:
        linear-gradient(180deg, rgba(11, 32, 35, 0.72), rgba(34, 77, 68, 0.42));
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.28);
}

#bestiary-screen .dofemage-monster-list::-webkit-scrollbar-thumb,
#bestiary-screen .dofemage-details-panel::-webkit-scrollbar-thumb {
    border: 2px solid rgba(12, 34, 37, 0.9);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(236, 255, 154, 0.96), rgba(91, 148, 104, 0.92));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.38),
        0 0 10px rgba(216, 255, 133, 0.28);
}

#bestiary-screen .dofemage-monster-list::-webkit-scrollbar-thumb:hover,
#bestiary-screen .dofemage-details-panel::-webkit-scrollbar-thumb:hover {
    background:
        linear-gradient(180deg, rgba(255, 244, 116, 0.98), rgba(111, 166, 93, 0.95));
}

#bestiary-screen .bestiary-storage-panel {
    min-height: 570px;
}

#bestiary-screen .bestiary-sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -2px 14px 14px;
    justify-content: flex-start;
    flex-wrap: wrap;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(204, 255, 194, 0.14);
    background:
        linear-gradient(180deg, rgba(75, 126, 103, 0.22), rgba(12, 34, 37, 0.18));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#bestiary-screen .bestiary-sort-controls > div {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

#bestiary-screen .bestiary-sort-controls .sort-btn {
    min-height: 30px;
    padding: 7px 11px !important;
    border: 1px solid rgba(221, 255, 214, 0.24) !important;
    border-radius: 7px !important;
    background:
        linear-gradient(180deg, rgba(92, 150, 124, 0.64), rgba(24, 63, 62, 0.9)) !important;
    color: #f2ffe8 !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -10px 14px rgba(0, 0, 0, 0.18),
        0 5px 12px rgba(0, 0, 0, 0.22);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

#bestiary-screen .bestiary-sort-controls .sort-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(235, 255, 123, 0.74) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -10px 14px rgba(0, 0, 0, 0.16),
        0 7px 16px rgba(0, 0, 0, 0.25),
        0 0 16px rgba(216, 255, 133, 0.18);
}

#bestiary-screen .bestiary-sort-controls .sort-btn.active {
    border-color: rgba(255, 243, 107, 0.86) !important;
    background:
        linear-gradient(180deg, rgba(211, 230, 105, 0.82), rgba(65, 117, 76, 0.94)) !important;
    color: #fffbe0 !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        inset 0 -10px 14px rgba(0, 0, 0, 0.16),
        0 0 0 2px rgba(255, 243, 107, 0.22),
        0 0 18px rgba(255, 243, 107, 0.32);
}

#bestiary-screen .bestiary-monster-list {
    grid-template-columns: 1fr;
}

#bestiary-screen #bestiary-storage-list {
    grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
    gap: 10px;
    padding-top: 8px;
}

#bestiary-screen .bestiary-list-card {
    min-width: 0;
}

#bestiary-screen .bestiary-list-card:not(.selected) .squad-badge {
    display: none;
}

#bestiary-screen .bestiary-storage-card {
    position: relative;
    min-height: 174px;
    padding: 11px 8px 10px;
    display: grid;
    grid-template-rows: 32px 100px 20px;
    justify-items: center;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(211, 255, 210, 0.14);
    border-radius: 8px;
    background:
        radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--dofemon-type-color, #355f58) 22%, transparent), transparent 48%),
        linear-gradient(180deg, rgba(75, 126, 103, 0.24), rgba(12, 34, 37, 0.34));
    box-shadow: inset 0 -14px 22px rgba(7, 24, 28, 0.16), 0 10px 20px rgba(0, 0, 0, 0.12);
    cursor: grab;
    overflow: visible;
}

#bestiary-screen .bestiary-storage-card:hover {
    transform: translateY(-2px);
    border-color: rgba(235, 255, 123, 0.82);
}

#bestiary-screen .bestiary-storage-card.active {
    border-width: 2px;
    border-color: #fff36b;
    box-shadow:
        0 0 0 4px rgba(255, 243, 107, 0.78),
        0 0 28px rgba(255, 243, 107, 0.58),
        0 12px 26px rgba(0, 0, 0, 0.24);
}

#bestiary-screen .dofemage-team-card.active {
    border-color: #fff36b;
    box-shadow:
        0 0 0 4px rgba(255, 243, 107, 0.82),
        0 0 30px rgba(255, 243, 107, 0.62),
        0 12px 28px rgba(0, 0, 0, 0.28);
}

#bestiary-screen .bestiary-storage-name {
    width: min(100%, 128px);
    max-width: 100%;
    min-height: 27px;
    padding: 6px 8px 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid rgba(218, 255, 202, 0.32);
    background:
        linear-gradient(180deg, rgba(82, 149, 133, 0.72), rgba(31, 82, 80, 0.62)),
        linear-gradient(90deg, rgba(188, 255, 206, 0.18), rgba(255, 255, 255, 0) 88%);
    color: #f7fff2;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.05;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -8px 10px rgba(0, 0, 0, 0.12),
        0 4px 9px rgba(0, 0, 0, 0.18);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

#bestiary-screen .bestiary-storage-hex {
    position: relative;
    width: 92px;
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

#bestiary-screen .bestiary-storage-hex::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    background:
        radial-gradient(circle at 44% 30%, color-mix(in srgb, var(--dofemon-type-color, #355f58) 78%, white 22%), transparent 58%),
        linear-gradient(180deg, color-mix(in srgb, var(--dofemon-type-color, #355f58) 90%, white 10%), color-mix(in srgb, var(--dofemon-type-color, #355f58) 78%, black 22%)),
        var(--dofemon-type-color, #355f58);
    border: 1px solid rgba(202, 255, 185, 0.24);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -10px 14px rgba(0, 0, 0, 0.2),
        0 7px 14px rgba(0, 0, 0, 0.26);
}

#bestiary-screen .bestiary-storage-sprite {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    max-width: 102px;
    max-height: 102px;
    object-fit: contain;
    transform: translate(-50%, -50%);
    pointer-events: none;
    filter: drop-shadow(0 5px 6px rgba(0, 0, 0, 0.46));
}

#bestiary-screen .bestiary-storage-fallback {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 92px;
    height: 92px;
    transform: translate(-50%, -50%);
    z-index: 2;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.62);
}

#bestiary-screen .bestiary-storage-level {
    min-width: 58px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(18, 29, 34, 0.88);
    border: 1px solid rgba(235, 255, 182, 0.48);
    color: #f7ffe1;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
}

#bestiary-screen #bestiary-details-panel {
    min-height: 0;
}

#bestiary-screen .dofemon-detail-card {
    width: min(100%, 410px);
}

#bestiary-screen .dofemage-empty-state {
    color: rgba(235, 250, 232, 0.62);
}

@media (max-width: 1180px) {
    #bestiary-screen .bestiary-layout {
        grid-template-columns: minmax(0, 1fr) minmax(390px, 0.92fr);
    }

    #bestiary-screen .bestiary-details-panel {
        grid-column: 1 / -1;
        position: relative;
        top: auto;
    }
}

@media (max-width: 900px) {
    #bestiary-screen .bestiary-layout {
        width: min(100%, calc(100vw - 20px));
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    #bestiary-screen .bestiary-sort-controls {
        margin: 0 8px 8px;
    }

    #bestiary-screen #bestiary-storage-list {
        grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    }
}

.spell-tag {
    display: inline-block;
    background: #34495e;
    border: 1px solid #555;
    padding: 3px 8px;
    margin: 2px;
    border-radius: 12px;
    font-size: 10px;
    cursor: help;
    transition: 0.2s;
}
.spell-tag:hover { background: #9b59b6; color: white; transform: translateY(-2px); }

/* =========================================
   6. COMBAT (OPTIMISÉ)
   ========================================= */
   #game-layout {
    display: flex;
    flex-direction: column;
    gap: 0; /* Pas d'espace entre les éléments pour les coller */
    width: 100%;
    align-items: center;
}

#combatCanvasWrapper {
    width: 100%;
    max-width: 800px;
    aspect-ratio: 1/1;
    background: #2c3e50;
    border: 4px solid #444;
    border-top: none; /* Pas de bordure en haut pour coller avec le log */
    border-radius: 0 0 8px 8px; /* Arrondi seulement en bas */
    overflow: hidden; /* Clippe le zoom CSS pour qu'il reste dans le cadre */
    box-sizing: border-box;
    position: relative;
}

#combatCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

#pvp-offline-banner {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    max-width: calc(100% - 24px);
    padding: 8px 14px;
    border-radius: 8px;
    background: rgba(20, 16, 10, 0.88);
    border: 1px solid #c9a227;
    color: #f5e6b8;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    pointer-events: none;
}

/* Lot 15 : en mode spectateur, « Quitter » prend la place des boutons d'action
   (retour de Dadycus, 2026-09-17 : pas de bandeau en haut). */
#combat-spectator-actions {
    flex: 1;
    min-width: 0;
    min-height: 116px; /* même hauteur que #combat-actions-main */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    /* Centré sur le panneau ENTIER : on compense la colonne de l'entité active
       (80 px) et l'écart du panneau (10 px). */
    margin-right: 90px;
}

#combat-spectator-actions[hidden],
#combat-spectator-count[hidden] {
    display: none;
}

#spectator-watching-text {
    color: #f5e6b8;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

#spectator-leave-btn {
    width: min(100%, 360px);
    min-height: 64px;
    padding: 12px 24px;
    font-size: 18px;
    background: #c0392b;
}

#spectator-leave-btn:hover {
    background: #e74c3c;
}

/* Le spectateur n'a aucune action : on retire les panneaux, la jauge reste. */
#combat-screen.is-spectating #combat-actions-main,
#combat-screen.is-spectating #combat-actions-list,
#combat-screen.is-spectating #btn-run {
    display: none !important;
}

#combat-screen.is-spectating #combatCanvas {
    cursor: default;
}

/* Lot 15 : ce que voit le combattant observé. */
#combat-spectator-count {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 6;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(20, 16, 10, 0.88);
    border: 1px solid #c9a227;
    color: #f5e6b8;
    font-size: 13px;
    font-weight: 700;
    cursor: help;
}

#ui-panel {
    width: 100%;
    max-width: 800px;
    background: #2c3e50;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #555;
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: flex-start;
    box-sizing: border-box;
    margin-top: 10px; /* Petit espace entre le canvas et le panneau UI */
}

/* Nouvelle structure des actions de combat */
#combat-entity-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

#combat-actions-main {
    display: flex;
    flex: 1;
    min-width: 0;
    min-height: 116px; /* Hauteur fixe : 2 lignes de boutons (2 * 50px) + gap (8px) = 116px */
}

#combat-active-entity-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

#combat-timer-gauge {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    transform: translate(-50%, -50%) rotate(-90deg);
    pointer-events: none;
    z-index: 1;
    display: block;
    visibility: visible;
    opacity: 1;
    margin: 0;
    padding: 0;
}

#combat-timer-circle-bg {
    fill: none;
    stroke: #222;
    stroke-width: 12;
    opacity: 1;
}

#combat-timer-circle {
    fill: none;
    stroke: #ffd700;
    stroke-width: 12;
    stroke-dasharray: 263.89;
    stroke-dashoffset: 0;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s linear, stroke 0.3s ease;
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 1)) drop-shadow(0 0 3px rgba(255, 215, 0, 0.8));
    opacity: 1;
}

#combat-active-entity-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #34495e;
    border: 3px solid #555;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    position: relative;
    z-index: 2;
}

#combat-entity-display .btn-run {
    width: 80px;
    padding: 6px;
    font-size: 11px;
    background: #e74c3c;
    margin: 0;
    border: 4px solid #000;
    text-shadow: 
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        0 -2px 0 #000,
        0 2px 0 #000,
        -2px 0 0 #000,
        2px 0 0 #000;
}

#combat-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
    flex: 1;
    min-height: 0;
}

.combat-action-btn {
    background: #34495e;
    border: 4px solid #000;
    border-radius: 6px;
    color: white;
    font-weight: bold;
    font-size: 14px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    text-shadow: 
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        0 -2px 0 #000,
        0 2px 0 #000,
        -2px 0 0 #000,
        2px 0 0 #000;
}

.combat-action-btn:hover:not(:disabled) {
    background: #3d566e;
    border-color: #f1c40f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.combat-action-btn:active:not(:disabled) {
    transform: translateY(0);
}

.combat-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.7);
    background: #2c3e50 !important;
}

#combat-btn-spell {
    background: #9b59b6;
}

#combat-btn-item {
    background: #e67e22;
}

#combat-btn-dofemon {
    background: #3498db;
}

#combat-btn-end-turn {
    background: #27ae60;
}

#combat-actions-list {
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex: 1;
    min-width: 0;
    margin-left: 0;
    min-height: 116px; /* Même hauteur minimale que #combat-actions-main pour éviter le changement de taille */
    align-items: stretch;
}

#combat-actions-list #actions-container {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    position: relative; /* Créer un contexte de stacking */
}

/* Tooltip fixe pour les boutons de combat (pour éviter d'être coupé par overflow) */
.combat-tooltip-fixed {
    position: fixed;
    background: rgba(10, 10, 10, 0.95);
    color: #f1c40f;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #7f8c8d;
    font-size: 11px;
    white-space: pre-wrap;
    z-index: 999999; /* Z-index très élevé pour passer au-dessus de tout */
    width: max-content;
    max-width: 160px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.9);
    pointer-events: none;
    line-height: 1.3;
    animation: tooltipFade 0.2s forwards;
}

/* Masquer le tooltip CSS par défaut pour les boutons de combat */
.combat-btn-tooltip:hover::after {
    display: none !important;
}

#combat-actions-list #actions-container .combat-action-btn,
#combat-actions-list #actions-container .btn {
    width: 100%;
    min-width: 0;
}

#combat-actions-list .btn-cancel {
    background: #c0392b;
    width: auto;
    min-width: 50px;
    margin: 0;
    border: 4px solid #000;
    text-shadow: 
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        0 -2px 0 #000,
        0 2px 0 #000,
        -2px 0 0 #000,
        2px 0 0 #000;
    flex-shrink: 0;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: horizontal-tb;
    padding: 8px 12px;
}

/* Responsive pour mobile */
@media (max-width: 600px) {
    #combat-active-entity-wrapper {
        width: 70px;
        height: 70px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }
    
    #combat-timer-gauge {
        width: 90px !important;
        height: 90px !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) rotate(-90deg) !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    #combat-active-entity-circle {
        width: 70px;
        height: 70px;
        position: relative;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    #combat-entity-display .btn-run {
        width: 70px;
        font-size: 10px;
        padding: 5px;
    }
    
    .combat-action-btn {
        font-size: 12px;
        padding: 10px;
        min-height: 45px;
    }
    
    #combat-actions-list #actions-container {
        max-height: 150px;
    }
    
    #ui-panel {
        flex-direction: row;
        gap: 8px;
    }
    
    #combat-actions-main {
        flex: 1;
        min-width: 0;
    }
    
    #combat-actions-list {
        flex: 1;
        min-width: 0;
    }

    #combat-spectator-actions {
        margin-right: 88px; /* colonne de 80 px + écart de 8 px */
    }

    #spectator-leave-btn {
        min-height: 54px;
        padding: 10px 16px;
        font-size: 15px;
    }
}

/* Conteneur de la timeline en haut de l'écran de combat */
#combat-timeline-container {
    width: 100%;
    max-width: 800px;
    background: #2c3e50;
    padding: 10px;
    border-radius: 8px 8px 0 0; /* Arrondi seulement en haut */
    border: 1px solid #555;
    border-bottom: none; /* Pas de bordure en bas pour coller avec le log */
    margin-bottom: 0;
    box-sizing: border-box;
}

/* Timeline Intégrée et Discrète */
#timeline {
    display: flex;
    gap: 5px; /* Espacement réduit */
    background: transparent; /* Fond transparent pour fondre dans l'UI */
    padding: 0;
    border-radius: 0;
    justify-content: center;
    min-height: auto;
    margin-bottom: 0;
    border: none; /* Plus de bordure */
}

.timeline-entity {
    width: 28px; /* Taille réduite (avant 35px) */
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #444;
    font-size: 16px; /* Emoji plus petit */
    border: 2px solid transparent;
    transition: 0.3s;
}

.timeline-entity.active {
    border-color: #f1c40f; /* Bordure or pour le tour actif */
    transform: scale(1.2);
    background: #555;
    box-shadow: 0 0 5px rgba(241, 196, 15, 0.5);
    z-index: 10;
}

.timeline-entity-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* Dézoom de l'image du héros pour voir son corps en entier */
.timeline-hero-image {
    object-fit: contain;
    width: 80%;
    height: 80%;
}

/* Bordures colorées selon le type d'entité */
.timeline-enemy {
    border: 2px solid #e74c3c !important; /* Rouge pour les ennemis */
}

.timeline-ally,
.timeline-hero {
    border: 2px solid #2ecc71 !important; /* Vert pour les alliés et le héros */
}

/* La bordure active (or) doit avoir la priorité */
.timeline-entity.active.timeline-enemy {
    border-color: #f1c40f !important; /* Or pour le tour actif, même pour les ennemis */
}

.timeline-entity.active.timeline-ally,
.timeline-entity.active.timeline-hero {
    border-color: #f1c40f !important; /* Or pour le tour actif, même pour les alliés */
}

/* BOUTONS */
.btn {
    width: 100%;
    padding: 12px; /* Un peu moins haut */
    margin: 4px 0;
    color: white;
    border: 4px solid #000;
    border-radius: 6px;
    font-weight: bold;
    font-size: 13px;
    text-align: left;
    padding-left: 20px;
    cursor: pointer;
    position: relative; 
    transition: filter 0.2s, transform 0.1s;
    box-shadow: 0 3px 0 rgba(0,0,0,0.2);
    text-shadow: 
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        0 -2px 0 #000,
        0 2px 0 #000,
        -2px 0 0 #000,
        2px 0 0 #000;
}

.btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,0.2); }
.btn:disabled { 
    background: #555 !important; 
    opacity: 0.6; 
    cursor: not-allowed; 
    box-shadow: none; 
    transform: none;
}

.btn-attack { background: #c0392b; }
.btn-item { background: #e67e22; }
.btn-stone { background: #7f8c8d; color: #222; }
#btn-pass { 
    background: #f1c40f; 
    color: #222; 
    text-align: center; 
    margin-top: auto; 
}

.btn-flee {
    background: transparent;
    border: 1px solid #c0392b;
    color: #c0392b;
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
    padding: 8px;
    width: auto;
    align-self: center;
    border-radius: 20px;
    box-shadow: none;
}

#log {
    width: 100%;
    max-width: 800px;
    height: 80px; /* Un peu moins haut */
    overflow-y: auto;
    background: #1a1a1a;
    font-size: 10px;
    font-family: 'Consolas', monospace;
    padding: 6px;
    margin-top: 0; /* Pas de marge en haut pour coller avec la timeline */
    margin-bottom: 0; /* Pas de marge en bas pour coller avec le canvas */
    border: 1px solid #444;
    border-top: none; /* Pas de bordure en haut pour coller avec la timeline */
    border-radius: 0; /* Pas d'arrondi pour coller avec les autres éléments */
    color: #ccc;
    box-sizing: border-box;
}

/* =========================================
   COMBAT CHAT PRIVÉ
   ========================================= */

#combat-chat-zone {
    width: 100%;
    max-width: 800px;
    background: #1e2a35;
    border: 1px solid #3d566e;
    border-radius: 0 0 8px 8px;
    border-top: none;
    flex-direction: column;
    gap: 0;
    box-sizing: border-box;
    margin-top: 0;
}

#combat-chat-messages {
    height: 90px;
    overflow-y: auto;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    scrollbar-width: thin;
    scrollbar-color: #3d566e #1e2a35;
}

#combat-chat-messages::-webkit-scrollbar {
    width: 4px;
}

#combat-chat-messages::-webkit-scrollbar-track {
    background: #1e2a35;
}

#combat-chat-messages::-webkit-scrollbar-thumb {
    background: #3d566e;
    border-radius: 2px;
}

.combat-chat-msg {
    font-size: 12px;
    line-height: 1.3;
    word-break: break-word;
}

.combat-chat-msg .combat-chat-sender {
    font-weight: bold;
    color: #7fb3d3;
}

.combat-chat-msg.self .combat-chat-sender {
    color: #f1c40f;
}

.combat-chat-msg .combat-chat-text {
    color: #dce6f0;
}

#combat-chat-input-row {
    display: flex;
    gap: 0;
    border-top: 1px solid #2c3e50;
}

#combat-chat-input {
    flex: 1;
    background: #243342;
    border: none;
    border-radius: 0 0 0 8px;
    color: white;
    font-size: 13px;
    padding: 7px 10px;
    font-family: 'Lato', sans-serif;
    outline: none;
    box-sizing: border-box;
}

#combat-chat-input::placeholder {
    color: #556b7a;
}

#combat-chat-input:focus {
    background: #2c3e50;
}

#combat-chat-send {
    background: #27ae60;
    border: none;
    border-radius: 0 0 8px 0;
    color: white;
    font-size: 16px;
    padding: 7px 14px;
    cursor: pointer;
    transition: background 0.2s;
}

#combat-chat-send:hover {
    background: #2ecc71;
}

@media (max-width: 600px) {
    #combat-chat-messages {
        height: 75px;
    }
    #combat-chat-input {
        font-size: 12px;
        padding: 6px 8px;
    }
}

/* =========================================
   7. TOOLTIPS (BULLES D'INFO AMÉLIORÉES)
   ========================================= */

/* A. Tooltip Flottant (Suivi de souris en combat) */
#combat-tooltip {
    position: absolute;
    display: none;
    background: rgba(8, 12, 18, 0.96);
    border: 1px solid rgba(241, 196, 15, 0.45);
    padding: 10px 12px;
    border-radius: 8px;
    color: white;
    font-size: 12px;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 10px 24px rgba(0,0,0,0.72);
    white-space: normal;
    min-width: 220px;
    max-width: 280px;
    max-height: 70vh;
    overflow-y: auto;
    backdrop-filter: blur(6px);
    line-height: 1.35;
}

.combat-inspect-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.combat-inspect-name {
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.02em;
    min-width: 0;
}

.combat-inspect-type {
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.combat-inspect-bar {
    position: relative;
    height: 16px;
    margin-bottom: 6px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #07100a;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.combat-inspect-bar--hp {
    background: #5a1212;
}

.combat-inspect-bar--hp .combat-inspect-bar-fill {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 48%), linear-gradient(90deg, #e74c3c, #c0392b);
}

.combat-inspect-bar--pm {
    background: #0d2e18;
}

.combat-inspect-bar--pm .combat-inspect-bar-fill {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 48%), linear-gradient(90deg, #2ecc71, #1e9e53);
}

.combat-inspect-bar-fill {
    display: block;
    height: 100%;
}

.combat-inspect-bar strong {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 2px #000, 0 0 4px rgba(0, 0, 0, 0.85);
    pointer-events: none;
}

.combat-inspect-core {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    margin: 8px 0 2px;
    font-size: 11px;
    color: #c5d0d6;
}

.combat-inspect-core b {
    color: #fff;
    margin-left: 2px;
}

.combat-inspect-section {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.combat-inspect-section-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.combat-inspect-section--passives .combat-inspect-section-title { color: #f1c40f; }
.combat-inspect-section--buffs .combat-inspect-section-title { color: #2ecc71; }
.combat-inspect-section--debuffs .combat-inspect-section-title { color: #e74c3c; }

.combat-inspect-fx {
    margin-bottom: 4px;
    padding: 4px 6px;
    border-radius: 4px;
    border-left: 2px solid #f1c40f;
    background: rgba(255, 255, 255, 0.04);
    line-height: 1.25;
}

.combat-inspect-fx--buff { border-left-color: #2ecc71; }
.combat-inspect-fx--debuff { border-left-color: #e74c3c; }

.combat-inspect-fx-name {
    font-weight: 700;
    font-size: 11px;
    margin-bottom: 2px;
}

.combat-inspect-fx-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    color: #cfd8dc;
}

.combat-inspect-fx-duration {
    color: #f1c40f;
    font-weight: 800;
    flex-shrink: 0;
}

.combat-inspect-fx-desc {
    font-size: 10px;
    color: #bdc3c7;
}

.combat-inspect-fx-source {
    font-size: 10px;
    color: #95a5a6;
    font-style: italic;
    margin-top: 1px;
}

/* B. Tooltip Fixe (Inventaire & Équipement) - BASE */
.equip-slot.filled:hover::after,
.item-box:hover::after,
.btn:not(:disabled) {
    position: relative; /* S'assurer que le bouton est le contexte de positionnement */
    z-index: 1; /* Z-index de base pour le bouton */
}

.btn:not(:disabled):hover {
    z-index: 100000; /* Z-index très élevé au survol pour que le tooltip passe au-dessus */
}

.btn:not(:disabled):hover::after {
    content: attr(data-tooltip);
    position: absolute;
    
    /* Par défaut : Au-dessus et centré */
    bottom: 110%; 
    left: 50%;
    transform: translateX(-50%);
    
    background: rgba(10, 10, 10, 0.95);
    color: #f1c40f;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #7f8c8d;
    font-size: 11px;
    white-space: pre-wrap;
    z-index: 100001; /* Z-index encore plus élevé pour le tooltip lui-même */
    width: max-content;
    max-width: 160px; /* Moins large pour éviter les débordements */
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.9);
    pointer-events: none;
    line-height: 1.3;
    opacity: 0;
    animation: tooltipFade 0.2s forwards;
}

/* --- LOGIQUE INTELLIGENTE POUR L'INVENTAIRE --- */

/* 1. Les objets de la colonne de GAUCHE (1, 6, 11...) : On aligne à gauche */
.inv-grid .item-box:nth-child(5n+1):hover::after {
    left: 0;
    transform: none; /* On enlève le centrage */
    text-align: left;
}

/* 2. Les objets de la colonne de DROITE (5, 10, 15...) : On aligne à droite */
.inv-grid .item-box:nth-child(5n):hover::after {
    left: auto; /* On annule le left */
    right: 0;   /* On colle à droite */
    transform: none;
    text-align: right;
}

/* 3. Les 5 premiers objets (1ère ligne) : On affiche EN DESSOUS (pour ne pas couper en haut) */
.inv-grid .item-box:nth-child(-n+5):hover::after {
    bottom: auto;
    top: 115%;
}

/* --- LOGIQUE POUR LES BOUTONS DE SORTS EN COMBAT --- */
/* Les boutons de sorts en haut (premières lignes) : afficher le tooltip en bas */
.spell-btn-top:hover {
    z-index: 100000; /* Même z-index élevé pour les boutons en haut */
}

.spell-btn-top:hover::after {
    bottom: auto;
    top: 115%;
    animation: tooltipFadeBottom 0.2s forwards;
}

@keyframes tooltipFadeBottom {
    from { opacity: 0; transform: translate(-50%, -5px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* --- LOGIQUE POUR L'ÉQUIPEMENT --- */
/* (J'ai supprimé la règle qui forçait le casque vers le bas. Tout va vers le haut maintenant) */

/* Animation d'apparition */
@keyframes tooltipFade {
    from { opacity: 0; transform: translate(-50%, 5px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 768px), (pointer: coarse) {
    .equip-slot.filled:hover::after,
    .item-box:hover::after,
    .btn:not(:disabled):hover::after,
    .inv-grid .item-box:nth-child(5n+1):hover::after,
    .inv-grid .item-box:nth-child(5n):hover::after,
    .inv-grid .item-box:nth-child(-n+5):hover::after {
        content: none;
        display: none;
        animation: none;
    }

    #hub-screen .inventory-tab,
    #hub-screen .item-box,
    #hub-screen .hero-equipment-slot,
    #hub-screen .skill-btn {
        touch-action: manipulation;
    }
}

/* Petits ajustements d'animation pour les cas spécifiques (Gauche/Droite) */
.inv-grid .item-box:nth-child(5n+1):hover::after { animation: tooltipFadeLeft 0.2s forwards; }
.inv-grid .item-box:nth-child(5n):hover::after { animation: tooltipFadeRight 0.2s forwards; }

@keyframes tooltipFadeLeft { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes tooltipFadeRight { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }


/* =========================================
   8. MAGASIN (SHOP)
   ========================================= */
#shop-screen.screen {
    background:
        radial-gradient(circle at 16% 10%, rgba(94, 184, 255, 0.2), transparent 28%),
        radial-gradient(circle at 84% 8%, rgba(42, 115, 196, 0.22), transparent 32%),
        linear-gradient(135deg, rgba(11, 30, 58, 0.97), rgba(16, 55, 96, 0.95) 54%, rgba(18, 72, 112, 0.96));
    border: 1px solid rgba(180, 220, 255, 0.18);
    box-shadow: inset 0 0 90px rgba(5, 16, 34, 0.78), 0 24px 80px rgba(0, 0, 0, 0.48);
}

#shop-screen > h1 {
    color: #ffd84a !important;
    text-shadow: 0 3px 14px rgba(0, 0, 0, 0.58), 0 0 20px rgba(80, 180, 255, 0.36);
}

.shop-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px;
    max-height: 500px;
    overflow-y: auto;
}

#shop-screen .shop-wallet-banner,
#dofemon-shop-screen .shop-wallet-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: fit-content;
    min-width: 310px;
    margin: 0 auto 14px;
    padding: 8px 18px;
    border-radius: 8px;
    border: 2px solid rgba(255, 215, 0, 0.58);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.18)),
        rgba(12, 28, 54, 0.9);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        inset 0 -16px 22px rgba(0, 0, 0, 0.18),
        0 0 22px rgba(255, 215, 0, 0.24),
        0 14px 26px rgba(0, 0, 0, 0.28);
    color: #ffd700;
    font-size: 26px;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
    text-shadow:
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        0 0 14px rgba(255, 215, 0, 0.52);
}

#shop-screen .shop-wallet-banner img,
#dofemon-shop-screen .shop-wallet-banner img {
    width: 45px !important;
    height: 45px !important;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.48));
}

#shop-screen .shop-mode-tabs,
#dofemon-shop-screen .shop-mode-tabs {
    width: min(430px, calc(100% - 28px));
    margin: 0 auto 16px;
}

#shop-screen .shop-dofedex-tabs,
#dofemon-shop-screen .shop-dofedex-tabs {
    gap: 7px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(186, 226, 255, 0.2);
    background:
        linear-gradient(180deg, rgba(73, 126, 178, 0.24), rgba(9, 28, 55, 0.2));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

#shop-screen .shop-dofedex-tabs .inventory-tab,
#dofemon-shop-screen .shop-dofedex-tabs .inventory-tab {
    min-height: 32px;
    border: 1px solid rgba(199, 229, 255, 0.26) !important;
    border-radius: 7px !important;
    background:
        linear-gradient(180deg, rgba(76, 137, 190, 0.72), rgba(19, 58, 102, 0.94)) !important;
    color: #eef8ff !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -10px 14px rgba(0, 0, 0, 0.18),
        0 5px 12px rgba(0, 0, 0, 0.24);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.58);
}

#shop-screen .shop-dofedex-tabs .inventory-tab:hover,
#dofemon-shop-screen .shop-dofedex-tabs .inventory-tab:hover {
    border-color: rgba(255, 230, 105, 0.78) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        inset 0 -10px 14px rgba(0, 0, 0, 0.16),
        0 7px 16px rgba(0, 0, 0, 0.25),
        0 0 16px rgba(116, 190, 255, 0.22);
}

#shop-screen .shop-dofedex-tabs .inventory-tab.active,
#dofemon-shop-screen .shop-dofedex-tabs .inventory-tab.active {
    border-color: rgba(255, 230, 105, 0.9) !important;
    background:
        linear-gradient(180deg, rgba(255, 215, 70, 0.9), rgba(48, 125, 184, 0.96)) !important;
    color: #fffbe0 !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -10px 14px rgba(0, 0, 0, 0.17),
        0 0 0 2px rgba(255, 230, 105, 0.23),
        0 0 18px rgba(255, 230, 105, 0.3);
}

#shop-screen .shop-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(330px, 0.78fr);
    align-items: start;
    gap: 24px;
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

#shop-screen .shop-section-panel,
#shop-screen .shop-details-panel {
    width: auto !important;
    max-width: none !important;
    max-height: 76vh;
    border-radius: 8px;
    border: 1px solid rgba(180, 220, 255, 0.26);
    background:
        radial-gradient(circle at 18% 0%, rgba(116, 190, 255, 0.18), transparent 34%),
        linear-gradient(180deg, rgba(55, 109, 159, 0.42), rgba(13, 41, 78, 0.76));
    box-shadow: inset 0 0 34px rgba(137, 205, 255, 0.1), 0 18px 45px rgba(0, 0, 0, 0.28);
}

#shop-screen .shop-section-panel {
    min-height: 570px;
    display: flex;
    flex-direction: column;
}

#shop-screen .shop-section-panel > .section-title,
#shop-screen .shop-details-panel > .section-title {
    color: #eef8ff;
    margin: 0 0 12px;
    letter-spacing: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

#shop-screen .shop-details-panel {
    position: sticky;
    top: 0;
    overflow-y: auto;
    padding: 16px;
}

#shop-screen #shop-details-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    min-height: 480px;
}

.shop-item {
    background:
        radial-gradient(circle at 52px 50%, rgba(112, 190, 255, 0.16), transparent 58px),
        linear-gradient(90deg, rgba(10, 35, 69, 0.44), rgba(69, 128, 184, 0.08));
    border: 1px solid rgba(190, 225, 255, 0.16);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    transition: all 0.2s;
}
.shop-item:hover {
    border-color: rgba(255, 230, 105, 0.48);
    box-shadow: inset 0 0 22px rgba(137, 205, 255, 0.09), 0 10px 22px rgba(0, 0, 0, 0.2);
}

.shop-item-image-button {
    width: 52px;
    height: 52px;
    margin-right: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    flex: 0 0 auto;
}

.shop-item-image-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.18s ease, filter 0.18s ease;
}

.shop-item-image-button:hover img,
.shop-item-image-button:focus-visible img {
    filter: brightness(1.16) drop-shadow(0 0 10px rgba(255, 215, 0, 0.42));
    transform: scale(1.08);
}

.shop-item-image-button:focus-visible {
    outline: 2px solid #ffd700;
    outline-offset: 3px;
    border-radius: 6px;
}

#shop-buy-list .shop-item-info > img,
#shop-buy-list .shop-item > div:first-child > img {
    width: 58px !important;
    height: 58px !important;
    margin-right: 14px !important;
    cursor: pointer;
    transition: transform 0.18s ease, filter 0.18s ease;
}

#shop-buy-list .shop-item-info > img:hover,
#shop-buy-list .shop-item > div:first-child > img:hover {
    filter: brightness(1.16) drop-shadow(0 0 10px rgba(255, 215, 0, 0.42));
    transform: scale(1.08);
}

.shop-item-info {
    flex: 1;
    min-width: 0;
    padding-right: 10px;
    display: flex;
    align-items: center;
}

.shop-item-name {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 4px;
    color: #fff;
}

#shop-buy-list .shop-item div[style*="font-weight:bold"] {
    font-size: 18px !important;
}

.shop-item-description {
    font-size: 12px;
    color: #d7e8d5;
    line-height: 1.4;
}

.midas-event-shop-item {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    border: 2px solid #d4a017;
    background: rgba(212, 160, 23, 0.08);
    margin-bottom: 8px;
}
.midas-event-copy {
    text-align: left;
}
.midas-event-title {
    font-weight: bold;
    font-size: 15px;
    color: #f1c40f;
    margin-bottom: 4px;
}
.midas-event-badge {
    font-size: 11px;
    background: #d4a017;
    color: #1a1a2e;
    border-radius: 4px;
    padding: 1px 5px;
    margin-left: 4px;
}
.midas-event-desc {
    font-size: 12px;
    color: #aaa;
    line-height: 1.4;
}
.midas-event-offers {
    display: flex;
    gap: 8px;
    justify-content: space-between;
}
.midas-event-offer {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 4px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(241, 196, 15, 0.35);
    border-radius: 8px;
    cursor: pointer;
    color: inherit;
}
.midas-event-offer:hover,
.midas-event-offer:focus-visible {
    border-color: #f1c40f;
    outline: none;
}
.midas-event-glove {
    width: 64px;
    height: 64px;
    object-fit: contain;
    pointer-events: none;
}
.midas-event-price {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: bold;
    font-size: 13px;
    color: #f1c40f;
}
.midas-event-price img {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

.shop-detail-sale-action {
    width: min(100%, 280px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 10px;
}

.shop-detail-sale-price {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #ffd700;
    font-size: 18px;
    font-weight: 900;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.shop-detail-sale-price img {
    width: 20px;
    height: 20px;
}

.shop-detail-buy-btn,
.shop-detail-sell-btn,
.shop-detail-cancel-btn {
    width: 100%;
    min-height: 50px;
    border-radius: 8px;
    border: 3px solid #0b1020;
    color: #111827;
    font-size: 18px;
    font-weight: 900;
    text-transform: uppercase;
    text-shadow: none;
}

.shop-detail-buy-btn {
    background: linear-gradient(180deg, #61f29a, #20b95d) !important;
}

.shop-detail-sell-btn {
    background: linear-gradient(180deg, #ffe45c, #f1c40f) !important;
}

.shop-detail-cancel-btn {
    background: linear-gradient(180deg, #ff776a, #d9362e) !important;
    color: #ffffff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.55);
}

#buy-confirm-popup-overlay {
    z-index: 100080 !important;
}

#buy-confirm-popup {
    position: relative;
    z-index: 100081 !important;
}

#sell-confirm-popup-overlay {
    z-index: 100080 !important;
}

#sell-confirm-popup {
    position: relative;
    z-index: 100081 !important;
}

#dofemon-buy-confirm-popup-overlay,
#dofemon-sell-confirm-popup-overlay {
    z-index: 100080 !important;
}

#dofemon-buy-confirm-popup,
#dofemon-sell-confirm-popup {
    position: relative;
    z-index: 100081 !important;
}

#dofemon-shop-screen.screen {
    background:
        radial-gradient(circle at 16% 12%, rgba(98, 184, 255, 0.26), transparent 30%),
        radial-gradient(circle at 84% 8%, rgba(255, 224, 94, 0.14), transparent 26%),
        linear-gradient(180deg, rgba(5, 20, 42, 0.98) 0%, rgba(10, 45, 78, 0.98) 50%, rgba(4, 18, 38, 0.98) 100%);
    color: #eaf6ff;
}

#dofemon-shop-screen > h1 {
    margin: 0 0 14px 0;
    text-align: center;
    color: #ffe45c;
    text-shadow: 0 3px 0 #0b1020, 0 0 18px rgba(80, 175, 255, 0.42);
}

.dofemon-shop-wallet-banner img {
    width: 45px !important;
    height: 45px !important;
}

#dofemon-shop-screen .dofemon-shop-mode-tabs {
    display: flex;
    width: min(680px, calc(100% - 28px));
    box-sizing: border-box;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
}

#dofemon-shop-screen .dofemon-shop-mode-tabs .inventory-tab {
    flex: 1 1 0 !important;
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 900;
}

.dofemon-shop-layout {
    width: min(1120px, 96vw);
    margin: 0 auto;
    align-items: stretch;
    gap: 18px;
}

.dofemon-shop-section-panel,
.dofemon-shop-details-panel {
    width: min(470px, 45vw) !important;
    min-height: 620px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background:
        linear-gradient(180deg, rgba(13, 71, 116, 0.92), rgba(7, 36, 70, 0.96)),
        repeating-linear-gradient(135deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 7px);
    border: 3px solid rgba(124, 203, 255, 0.55);
    box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.28), 0 10px 24px rgba(0, 0, 0, 0.25);
}

.dofemon-shop-details-panel {
    width: min(430px, 38vw) !important;
}

.dofemon-shop-description {
    font-size: 12px;
    color: #cfefff;
    text-align: center;
    margin-bottom: 4px;
}

#dofemon-shop-buy-list,
#dofemon-shop-sell-list {
    flex: 1;
    min-height: 0;
    max-height: min(620px, calc(100vh - 325px));
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding-right: 4px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.dofemon-shop-row.card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 92px;
    padding: 10px;
    background: linear-gradient(135deg, rgba(14, 67, 110, 0.88), rgba(7, 33, 64, 0.94));
    border: 2px solid rgba(135, 211, 255, 0.42);
    border-radius: 8px;
    touch-action: pan-y;
}

.dofemon-shop-row.card:hover {
    border-color: rgba(255, 228, 92, 0.92);
    box-shadow: 0 0 14px rgba(255, 228, 92, 0.24);
}

.dofemon-shop-avatar {
    flex: 0 0 auto;
}

.dofemon-shop-row-info {
    flex: 1;
    min-width: 0;
}

.dofemon-shop-row-name {
    color: #ffffff;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.dofemon-shop-row-meta {
    color: #c8d7e6;
    font-size: 12px;
    margin-top: 4px;
}

.dofemon-shop-price-btn {
    width: 190px !important;
    height: 50px;
    gap: 5px;
    touch-action: manipulation;
}

.dofemon-shop-price-btn img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

#dofemon-shop-details-panel {
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 12px;
}

#dofemon-shop-screen #dofemon-shop-details-panel .dofemon-detail-card {
    width: min(100%, 430px);
}

.dofemon-shop-detail-action {
    margin-top: 2px;
}

#shop-screen #btn-use-energy-sphere {
    display: none;
}

#shop-screen #shop-details-panel .dofemon-detail-card {
    width: min(100%, 430px);
}

.shop-quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 320px;
    flex-shrink: 0;
}

.btn-quantity {
    background: #34495e;
    color: white;
    border: 2px solid #555;
    padding: 10px 14px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    font-size: 18px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.btn-quantity:hover {
    background: #2c3e50;
    filter: brightness(1.2);
    transform: scale(1.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.btn-quantity:active {
    transform: scale(0.95);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.shop-quantity-display {
    width: 45px;
    text-align: center;
    font-weight: bold;
    font-size: 18px;
    color: white;
    padding: 0 10px;
    flex-shrink: 0;
}

.btn-buy {
    background: linear-gradient(180deg, #ffe45c, #f1c40f) !important;
    color: #111827;
    border: 3px solid #0b1020;
    padding: 14px 24px;
    border-radius: 8px;
    font-weight: 900;
    cursor: pointer;
    font-size: 18px;
    width: 165px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    flex-shrink: 0;
    /* Pas de text-shadow pour les prix afin d'assurer une meilleure lisibilité */
}
.btn-buy:hover { 
    filter: brightness(1.15); 
    transform: scale(1.08); 
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}
.btn-buy:active { 
    transform: scale(0.96); 
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.shop-item-sell {
    cursor: pointer;
    border-color: #f1c40f; /* Bordure dorée pour indiquer vendable */
}
.shop-item-sell:hover {
    border-color: #ffd700;
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.26);
}

/* =========================================
   9. DOFEDEX & DOFEMAGE LISTS (NEW)
   ========================================= */

.dofedex-entry {
    color: white;
    padding: 15px;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    text-shadow: 1px 1px 2px #000;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(62,74,89,0.9), rgba(44,62,80,0.9));
}

.dofedex-entry:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}

/* DoFemons non capturés : image en noir et blanc dans le Dofedex */
.dofedex-img-uncaught {
    filter: grayscale(100%) drop-shadow(2px 2px 4px rgba(0,0,0,0.5)) !important;
}
#dofedex-details-panel .dofedex-img-uncaught {
    filter: grayscale(100%) drop-shadow(4px 4px 8px rgba(0,0,0,0.5)) !important;
}

/* Écran Dofedex : centrage et layout responsive */
#dofedex-screen {
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 10px;
    padding-right: 10px;
}

#dofedex-screen .hub-columns {
    width: 100%;
    max-width: 1200px;
    box-sizing: border-box;
}

/* Panneau de détails Dofedex : éviter débordement et bien centrer */
#dofedex-details-panel-container {
    box-sizing: border-box;
}

#dofedex-details-panel {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

#dofedex-details-panel .dofedex-details-header {
    max-width: 100%;
}

#dofedex-details-panel .dofedex-details-header h2 {
    word-break: break-word;
    overflow-wrap: break-word;
}

#dofedex-details-title {
    text-align: center;
    word-break: break-word;
}

.dofedex-entry.active {
    box-shadow: 0 8px 20px rgba(0,0,0,0.5), 0 0 24px rgba(46, 204, 113, 0.42) !important;
    transform: translateY(-3px);
}

.dofedex-mobile-detail-close {
    display: none;
}

#dofedex-screen .dofemon-card-capture {
    --passive-color: #46d88f;
}

#dofedex-screen .dofemon-card-capture-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 24px;
}

#dofedex-screen .dofemon-card-capture-row + .dofemon-card-capture-row {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#dofedex-screen .dofemon-card-capture-row span {
    color: var(--dofemon-card-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

#dofedex-screen .dofemon-card-capture-row strong {
    color: color-mix(in srgb, var(--dofemon-card-color, #8fb8c8) 42%, white 58%);
    font-size: 12px;
    text-align: right;
    text-transform: uppercase;
}

#dofedex-screen .dofedex-hidden-boss-card {
    width: min(100%, 360px);
    margin: 0 auto;
    padding: 28px 18px;
    border-radius: 10px;
    border: 2px solid rgba(241, 196, 15, 0.42);
    background: linear-gradient(180deg, rgba(44, 62, 80, 0.96), rgba(18, 28, 38, 0.96));
    text-align: center;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.38);
}

#dofedex-screen .dofedex-hidden-boss-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 112px;
    height: 112px;
    margin: 0 auto 14px;
    border-radius: 50%;
    border: 3px solid rgba(241, 196, 15, 0.72);
    background: rgba(0, 0, 0, 0.22);
    color: #f1c40f;
    font-size: 74px;
    font-weight: 900;
    line-height: 1;
}

#dofedex-screen .dofedex-hidden-boss-card p {
    margin: 0;
    color: #f1c40f;
    font-size: 15px;
    font-weight: 800;
}

#dofedex-screen .dofedex-spell-entry {
    width: 100%;
    height: 42px;
}

#dofedex-screen .dofedex-spell-detail-card .dofemon-card-frame {
    min-height: auto;
}

#dofedex-screen .dofedex-spell-detail-card .dofemon-card-body {
    margin-top: 10px;
}

#dofedex-screen .dofedex-spell-detail-card .dofemon-card-spell-detail {
    min-height: 250px;
}

#dofedex-screen .dofedex-spell-empty-state {
    width: min(100%, 360px);
    margin: 0 auto;
}

.dofemage-entry {
    background: #222;
    color: #ddd;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #3498db;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* =========================================
   9b. WEAKNESS CHARTS
   ========================================= */

.weakness-cycles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 10px 5px;
}

.weakness-cycle-card {
    background: linear-gradient(135deg, rgba(44,62,80,0.95), rgba(30,39,46,0.95));
    border: 2px solid rgba(230,126,34,0.4);
    border-radius: 16px;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.weakness-cycle-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 15px rgba(230,126,34,0.15);
}

.weakness-cycle-title {
    color: #e67e22;
    margin: 0 0 10px 0;
    font-size: 16px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.weakness-svg {
    width: 100%;
    max-width: 320px;
    height: auto;
}

.weakness-type-node-halo {
    filter: blur(1px);
}

.weakness-type-node-ring {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.weakness-type-icon {
    filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.42));
}

.weakness-type-label {
    paint-order: stroke;
    stroke: rgba(7, 18, 20, 0.88);
    stroke-width: 3px;
    stroke-linejoin: round;
}

@media (max-width: 768px) {
    .weakness-cycles-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   10. POINTS DE COMPÉTENCE
   ========================================= */

.skill-btn {
    background: #3498db;
    color: white;
    border: 1px solid #2980b9;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.skill-btn:hover:not(:disabled) {
    background: #2980b9;
    filter: brightness(1.1);
    transform: scale(1.1);
}

.skill-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.skill-btn:disabled {
    background: #555;
    border-color: #444;
    color: #aaa;
    cursor: not-allowed;
    opacity: 0.5;
}

/* =========================================
   11. TOAST NOTIFICATIONS
   ========================================= */

.toast {
    position: fixed;
    top: 60px;
    right: 20px;
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    border: 2px solid #3498db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    /* Un toast est le dernier mot de l'interface : il doit passer AU-DESSUS de tout
       ce qui peut être ouvert au moment où il part. À 100000 il passait sous la fiche
       détail plein écran du shop (100050) et sous les popups PVP (100100) — un refus
       d'achat s'affichait alors derrière l'écran qui venait de le déclencher, et le
       joueur voyait un bouton « qui ne fait rien » (2026-08-17). */
    z-index: 1000010;
    font-size: 14px;
    font-weight: bold;
    min-width: 250px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastSlideIn 0.3s ease-out, toastFadeOut 0.3s ease-in 2.7s forwards;
    pointer-events: none;
}

.toast-success {
    border-color: #2ecc71;
    background: linear-gradient(135deg, #27ae60, #2c3e50);
}

.toast-error {
    border-color: #e74c3c;
    background: linear-gradient(135deg, #c0392b, #2c3e50);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(400px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastFadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

/* Toast de notification de vente NFT */
.toast-sale {
    border-color: #f39c12;
    background: linear-gradient(135deg, #e67e22, #2c3e50);
    animation: toastSlideIn 0.3s ease-out, toastFadeOut 0.3s ease-in 4.7s forwards;
}
.toast-sale-content {
    display: flex;
    align-items: center;
    gap: 8px;
}
.toast-sale-icon {
    font-size: 20px;
    animation: bounce 0.6s ease-in-out infinite;
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* =========================================
   12. OPTIMISATION MOBILE - DOFEDEX & TEAM
   ========================================= */

/* Sur mobile en portrait, élargir les panels DOFEDEX et TEAM */
/* Utilisation de max-width pour cibler les téléphones en portrait */
@media (max-width: 768px) and (orientation: portrait) {
    /* Espace pour settings (fixed) + close-btn (fixed) */
    #dofedex-screen,
    #dofemage-screen {
        padding-top: 115px !important;
    }
    
    /* DOFEDEX - Panel principal (liste des monstres) */
    #dofedex-main-panel {
        width: 90% !important;
        max-width: 90% !important;
    }

    /* DOFEDEX - Onglets : 2 lignes de 2 sur mobile */
    #dofedex-main-panel .inventory-tabs {
        flex-wrap: wrap;
    }
    #dofedex-main-panel .inventory-tab {
        flex: 1 1 40%;
    }

    /* DOFEDEX - Panel de détails */
    #dofedex-details-panel-container {
        width: 90% !important;
        max-width: 90% !important;
        position: relative !important;
        top: auto !important;
    }

    /* TEAM - Panel principal (liste des monstres) */
    #dofemage-screen .hub-columns:not(.dofemage-layout) .panel:first-child {
        width: 90% !important;
        max-width: 90% !important;
    }

    /* TEAM - Panel de détails */
    #dofemage-screen .hub-columns:not(.dofemage-layout) .panel:last-child {
        width: 90% !important;
        max-width: 90% !important;
        position: relative !important;
        top: auto !important;
    }

    /* Ajuster le conteneur hub-columns pour centrer les panels */
    #dofedex-screen .hub-columns,
    #dofemage-screen .hub-columns:not(.dofemage-layout) {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    /* Panneau détails Dofemon : avatar et stats responsive */
    #dofedex-details-panel .dofedex-details-avatar-wrap {
        width: min(200px, 70vw) !important;
        height: min(200px, 70vw) !important;
    }

    #dofedex-details-panel .dofedex-details-avatar-wrap img {
        max-width: min(150px, 55vw) !important;
        max-height: min(150px, 55vw) !important;
    }

    #dofedex-details-panel .dofedex-details-stats {
        grid-template-columns: 1fr !important;
    }

    #dofedex-details-panel .dofedex-details-header h2 {
        font-size: 1.25rem !important;
    }
}

/* Pour les très petits écrans en portrait */
@media (max-width: 480px) and (orientation: portrait) {
    /* DOFEDEX - Panel principal */
    #dofedex-main-panel {
        width: 90% !important;
        max-width: 90% !important;
    }
    
    /* DOFEDEX - Panel de détails */
    #dofedex-details-panel-container {
        width: 90% !important;
        max-width: 90% !important;
    }

    #dofedex-details-panel {
        padding: 12px 10px !important;
    }

    #dofedex-details-panel .dofedex-details-avatar-wrap {
        width: min(160px, 65vw) !important;
        height: min(160px, 65vw) !important;
    }

    #dofedex-details-panel .dofedex-details-stats {
        grid-template-columns: 1fr !important;
    }

    #dofedex-details-panel .dofedex-details-header h2 {
        font-size: 1.1rem !important;
    }
    
    /* TEAM - Panel principal */
    #dofemage-screen .hub-columns:not(.dofemage-layout) .panel:first-child {
        width: 90% !important;
        max-width: 90% !important;
    }
    
    /* TEAM - Panel de détails */
    #dofemage-screen .hub-columns:not(.dofemage-layout) .panel:last-child {
        width: 90% !important;
        max-width: 90% !important;
    }
}

/* Fallback pour les navigateurs qui ne supportent pas orientation */
/* On utilise max-width avec une hauteur minimale pour cibler les téléphones en portrait */
@media (max-width: 768px) and (min-height: 500px) {
    /* Espace pour settings (fixed) + close-btn (fixed) */
    #dofedex-screen,
    #dofemage-screen {
        padding-top: 115px !important;
    }
    
    /* DOFEDEX - Panel principal (liste des monstres) */
    #dofedex-main-panel {
        width: 90% !important;
        max-width: 90% !important;
    }

    /* DOFEDEX - Onglets : 2 lignes de 2 sur mobile */
    #dofedex-main-panel .inventory-tabs {
        flex-wrap: wrap;
    }
    #dofedex-main-panel .inventory-tab {
        flex: 1 1 40%;
    }

    /* DOFEDEX - Panel de détails */
    #dofedex-details-panel-container {
        width: 90% !important;
        max-width: 90% !important;
        position: relative !important;
        top: auto !important;
    }

    /* TEAM - Panel principal (liste des monstres) */
    #dofemage-screen .hub-columns:not(.dofemage-layout) .panel:first-child {
        width: 90% !important;
        max-width: 90% !important;
    }

    /* TEAM - Panel de détails */
    #dofemage-screen .hub-columns:not(.dofemage-layout) .panel:last-child {
        width: 90% !important;
        max-width: 90% !important;
        position: relative !important;
        top: auto !important;
    }

    /* Ajuster le conteneur hub-columns pour centrer les panels */
    #dofedex-screen .hub-columns,
    #dofemage-screen .hub-columns:not(.dofemage-layout) {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    #dofedex-details-panel .dofedex-details-avatar-wrap {
        width: min(200px, 70vw) !important;
        height: min(200px, 70vw) !important;
    }

    #dofedex-details-panel .dofedex-details-stats {
        grid-template-columns: 1fr !important;
    }
}

/* =========================================
   13. OPTIMISATION MOBILE - SHOP
   ========================================= */

/* Sur mobile, faire que les panels du shop épousent parfaitement les limites */
@media (max-width: 768px) {
    #shop-screen,
    #dofemon-shop-screen,
    #bestiary-screen,
    #marabou-screen,
    #quest-screen,
    #hero-skin-screen {
        padding-top: 115px !important; /* Espace pour settings (fixed) + close-btn (fixed) */
    }

    #shop-screen .close-btn,
    #dofemon-shop-screen .close-btn,
    #bestiary-screen .close-btn,
    #marabou-screen .close-btn,
    #quest-screen .close-btn,
    #hero-skin-screen .close-btn {
        position: absolute;
        top: 62px;
        right: 15px;
        z-index: 9999;
    }
    
    #shop-screen .panel {
        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        padding: 12px;
    }

    #hero-skin-screen .hero-skin-layout {
        width: calc(100% - 20px);
        margin-top: 10px;
    }

    #hero-skin-screen .hero-skin-panel {
        padding: 12px;
    }

    #hero-skin-screen .hero-skin-header {
        grid-template-columns: 112px minmax(0, 1fr);
        gap: 12px;
        padding: 0 0 14px;
        margin-bottom: 14px;
    }

    #hero-skin-screen .hero-skin-heading h2 {
        font-size: 20px;
        line-height: 1.15;
    }

    #hero-skin-screen .hero-skin-heading p {
        font-size: 12px;
        line-height: 1.35;
    }

    #hero-skin-screen .hero-skin-list {
        grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
        gap: 12px;
        padding: 0;
    }

    #hero-skin-screen .hero-skin-card {
        min-height: 184px;
        padding: 12px 9px;
    }

    #hero-skin-screen .hero-skin-preview {
        width: 96px;
        height: 96px;
    }

    #marabou-screen .marabou-layout {
        width: calc(100% - 20px);
        margin-top: 10px;
    }

    #marabou-screen .marabou-panel {
        padding: 12px;
    }

    #marabou-screen .marabou-portrait {
        width: 136px;
    }

    #marabou-screen .marabou-points-grid {
        grid-template-columns: 1fr;
    }

    #marabou-screen .marabou-point-total-row {
        grid-column: auto;
    }

    #marabou-screen .marabou-reset-btn {
        min-height: 54px;
        font-size: 14px;
        padding: 13px 14px;
    }
    
    #shop-screen .hub-columns {
        width: 100%;
        padding: 0 10px;
        gap: 15px;
    }

    #shop-screen .shop-layout {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 0 10px;
    }

    #shop-screen .shop-section-panel,
    #shop-screen .shop-details-panel {
        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        min-height: auto;
        max-height: none;
        position: static;
    }

    #shop-screen #shop-details-panel {
        min-height: 260px;
    }

    #shop-screen .shop-details-panel {
        display: none;
    }

    #shop-screen.shop-mobile-detail-open .shop-details-panel {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 100050;
        width: 100vw !important;
        max-width: none !important;
        height: 100dvh;
        max-height: none;
        min-height: 100dvh;
        padding: 0;
        border: 0;
        border-radius: 0;
        background:
            radial-gradient(circle at 50% 12%, rgba(94, 184, 255, 0.24), transparent 34%),
            linear-gradient(180deg, rgba(5, 20, 42, 0.98), rgba(15, 54, 92, 0.98));
        overflow: hidden;
        box-shadow: none;
    }

    #shop-screen.shop-mobile-detail-open .shop-details-panel > .section-title {
        display: none;
    }

    #shop-screen.shop-mobile-detail-open #shop-details-panel {
        width: 100%;
        height: 100%;
        min-height: 0;
        padding: 54px 14px 22px;
        overflow-y: auto;
        box-sizing: border-box;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 230, 105, 0.8) rgba(10, 30, 56, 0.58);
    }

    #shop-screen.shop-mobile-detail-open #shop-details-panel .dofemon-detail-card {
        width: min(100%, 430px);
        margin: 0 auto;
        filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.34));
    }

    #shop-screen.shop-mobile-detail-open .shop-detail-sale-action {
        width: min(100%, 430px);
        margin: 14px auto 0;
        position: sticky;
        bottom: 0;
        padding: 10px 0 0;
        background: linear-gradient(180deg, transparent, rgba(5, 20, 42, 0.96) 34%);
    }

    #dofemon-shop-screen .dofemon-shop-layout {
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 14px;
    }

    #dofemon-shop-screen .dofemon-shop-section-panel {
        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        min-height: 0;
        max-height: none;
        padding: 12px;
    }

    #dofemon-shop-buy-list,
    #dofemon-shop-sell-list {
        max-height: calc(100dvh - 310px);
        min-height: 260px;
        padding: 2px 2px 18px;
        touch-action: pan-y !important;
    }

    #dofemon-shop-screen .dofemon-shop-details-panel {
        display: none;
    }

    #dofemon-shop-screen.dofemon-shop-mobile-detail-open .dofemon-shop-details-panel {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 100050;
        width: 100vw !important;
        max-width: none !important;
        height: 100dvh;
        min-height: 100dvh;
        padding: 0;
        border: 0;
        border-radius: 0;
        background:
            radial-gradient(circle at 50% 12%, rgba(94, 184, 255, 0.24), transparent 34%),
            linear-gradient(180deg, rgba(5, 20, 42, 0.98), rgba(15, 54, 92, 0.98));
        overflow: hidden;
        box-shadow: none;
    }

    #dofemon-shop-screen.dofemon-shop-mobile-detail-open .dofemon-shop-details-panel > .section-title {
        display: none;
    }

    #dofemon-shop-screen.dofemon-shop-mobile-detail-open #dofemon-shop-details-panel {
        width: 100%;
        height: 100%;
        min-height: 0;
        padding: 54px 14px 22px;
        overflow-y: auto;
        box-sizing: border-box;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 230, 105, 0.8) rgba(10, 30, 56, 0.58);
    }

    #dofemon-shop-screen.dofemon-shop-mobile-detail-open #dofemon-shop-details-panel .dofemon-detail-card {
        width: min(100%, 430px);
        margin: 0 auto;
        filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.34));
    }

    #dofemon-shop-screen.dofemon-shop-mobile-detail-open .dofemon-shop-detail-action {
        width: min(100%, 430px);
        margin: 14px auto 0;
        position: sticky;
        bottom: 0;
        padding: 10px 0 0;
        background: linear-gradient(180deg, transparent, rgba(5, 20, 42, 0.96) 34%);
    }

    .dofemon-shop-row.card {
        min-height: 92px;
    }

    .dofemon-shop-price-btn {
        width: 128px !important;
    }
    
    .shop-quantity-controls {
        width: 100% !important;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
    }
    
    .shop-item {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .shop-item > div:first-child {
        padding-right: 0;
    }

    .midas-event-glove {
        width: 48px;
        height: 48px;
    }
    .midas-event-price {
        font-size: 12px;
    }
}

/* Pour les très petits écrans */
@media (max-width: 480px) {
    #shop-screen .panel {
        width: calc(100% - 10px) !important;
        max-width: calc(100% - 10px) !important;
        padding: 10px;
        min-height: auto;
    }
    
    #shop-screen .hub-columns {
        padding: 0 5px;
        gap: 12px;
    }

    #shop-screen .shop-layout {
        padding: 0 5px;
    }

    #shop-screen .shop-wallet-banner {
        font-size: 20px;
    }
    
    .shop-quantity-controls {
        width: 100% !important;
        gap: 5px;
    }
    
    .btn-quantity {
        width: 38px !important;
        height: 38px !important;
        font-size: 16px;
        padding: 8px 10px;
    }
    
    .shop-quantity-display {
        width: 35px !important;
        font-size: 16px;
    }
    
    .btn-buy {
        width: 100% !important;
        height: 42px;
        font-size: 16px;
        padding: 12px 20px;
    }

    #dofemon-shop-screen .dofemon-shop-mode-tabs {
        display: flex;
        width: calc(100% - 24px);
        max-width: 100%;
        box-sizing: border-box;
        justify-content: center;
        gap: 9px;
        margin-left: auto;
        margin-right: auto;
    }

    #dofemon-shop-screen .dofemon-shop-mode-tabs .inventory-tab {
        min-height: 46px;
        font-size: 18px;
        flex: 1 1 0 !important;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #dofemon-shop-screen .dofemon-shop-row.card {
        display: grid;
        grid-template-columns: 56px minmax(0, 1fr) 82px;
        align-items: center;
        gap: 8px;
        min-height: 78px;
        padding: 8px;
        overflow: hidden;
        touch-action: pan-y !important;
        transition: border-color 0.18s ease, box-shadow 0.18s ease;
    }

    #dofemon-shop-screen .dofemon-shop-row.card:hover {
        transform: none;
    }

    #dofemon-shop-screen .dofemon-shop-avatar {
        width: 56px !important;
        height: 56px !important;
    }

    #dofemon-shop-screen .dofemon-shop-avatar img {
        width: auto !important;
        height: auto !important;
        max-width: 92% !important;
        max-height: 92% !important;
    }

    #dofemon-shop-screen .dofemon-shop-row-info {
        min-width: 0;
        overflow: hidden;
    }

    #dofemon-shop-screen .dofemon-shop-row-name {
        font-size: 15px;
        line-height: 1.1;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    #dofemon-shop-screen .dofemon-shop-row-meta {
        font-size: 11px;
        line-height: 1.2;
    }

    #dofemon-shop-screen .dofemon-shop-price-btn {
        width: 82px !important;
        min-width: 82px !important;
        height: 38px !important;
        padding: 6px 7px !important;
        gap: 3px;
        font-size: 13px;
        justify-self: end;
        flex-shrink: 0;
    }

    #dofemon-shop-screen .dofemon-shop-price-btn img {
        width: 15px !important;
        height: 15px !important;
        margin-left: 0 !important;
    }
    
    .shop-item {
        padding: 10px;
    }
    
    .shop-grid {
        gap: 10px;
        padding: 5px;
    }
}

/* =========================================
   14. OPTIMISATION MOBILE - DIALOGUE PNJ
   ========================================= */

/* Styles de base pour la bulle de dialogue PNJ */
#npc-dialog-bubble {
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Sur mobile, s'assurer que la bulle épouse parfaitement l'écran */
@media (max-width: 768px) {
    #npc-dialog-bubble {
        box-sizing: border-box !important;
        max-width: calc(100vw - 20px) !important;
        width: calc(100vw - 20px) !important;
        left: 10px !important;
        right: auto !important;
    }
    
    #npc-dialog-content {
        box-sizing: border-box;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Pour les très petits écrans */
@media (max-width: 480px) {
    #npc-dialog-bubble {
        left: 5px !important;
        right: auto !important;
        max-width: calc(100vw - 10px) !important;
        width: calc(100vw - 10px) !important;
        padding: 12px !important;
    }
}

/* =========================================
   15. OPTIMISATION MOBILE - BESTIAIRE
   ========================================= */

/* Titre bestiary en double taille */
#bestiary-screen h1 {
    font-size: 3em;
}

/* Sur mobile, faire que les panels du bestiaire épousent parfaitement les limites */
@media (max-width: 768px) {
    #bestiary-screen {
        width: 100% !important;
        max-width: 100% !important;
        padding: 115px 10px 10px 10px !important; /* Espace pour settings + close-btn */
        box-sizing: border-box;
    }
    
    #bestiary-screen .panel {
        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        padding: 12px;
        margin: 0 auto;
    }
    
    #bestiary-screen .hub-columns {
        width: 100%;
        padding: 0;
        gap: 15px;
        flex-direction: column;
        align-items: stretch;
    }
    
    #bestiary-screen h1 {
        font-size: 40px;
        margin-bottom: 10px;
        padding: 0 10px;
    }
    
    #bestiary-screen .close-btn {
        position: absolute;
        top: 62px;
        right: 15px;
        z-index: 9999;
    }
}

/* Pour les très petits écrans */
@media (max-width: 480px) {
    #bestiary-screen {
        width: 100% !important;
        max-width: 100% !important;
        padding: 115px 5px 5px 5px !important; /* Espace pour settings + close-btn */
        box-sizing: border-box;
    }
    
    #bestiary-screen .panel {
        width: calc(100% - 10px) !important;
        max-width: calc(100% - 10px) !important;
        padding: 10px;
        min-height: auto;
        margin: 0 auto;
    }
    
    #bestiary-screen .hub-columns {
        padding: 0;
        gap: 12px;
    }
    
    #bestiary-screen h1 {
        font-size: 36px;
        margin-bottom: 8px;
        padding: 0 5px;
    }
    
    /* Ajuster les boutons de tri pour qu'ils s'adaptent mieux */
    #bestiary-screen .sort-btn {
        font-size: 10px !important;
        padding: 5px 7px !important;
    }
    
    #bestiary-sort-label {
        font-size: 10px !important;
    }
    
    /* Ajuster le conteneur de tri */
    #bestiary-screen .panel > div:first-of-type {
        flex-wrap: wrap;
        gap: 4px;
    }
}

/* =========================================
   CALQUES PLEIN ECRAN (socle partage)
   ========================================= */
/* Sur iOS, 100vh vaut la hauteur BARRES MASQUEES : un calque en 100vh deborde
   sous la barre d'outils Safari, et tout ce qui est ancre en bas — un bouton
   "Continuer", "Acheter", "Fermer" — devient injoignable. Pire, le glissement
   qui devrait le rattraper part en rebond : l'ecran "remonte tout seul".
   100dvh suit la hauteur reellement visible ; 100vh reste en repli pour les
   WebKit anterieurs a iOS 15.4. L'ordre compte : le repli doit venir d'abord.
   --app-height (js/viewport.js) recouvre ensuite le chrome NATIF de Phantom,
   invisible a dvh : barre d'URL superposee a la WebView. Ne pas remettre
   bottom:0 ici — height + top suffisent, bottom etirerait sous la barre. */
.fullscreen-layer {
    position: fixed;
    top: 0;
    top: var(--app-offset-top, 0px);
    left: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    height: var(--app-height, 100dvh);
    box-sizing: border-box;
}

/* Calque qui HEBERGE un dialogue : il defile lui-meme et respecte la safe-area,
   pour que le bas du dialogue reste atteignable meme sur un petit ecran. */
.overlay-dialog-host {
    justify-content: center;
    /* "safe" : quand le dialogue est plus haut que l'ecran, on l'aligne en haut
       au lieu de le centrer — un centrage sort son sommet de la zone defilante,
       et ce sommet devient a son tour injoignable. Repli : centrage simple. */
    align-items: center;
    align-items: safe center;
    padding:
        max(10px, env(safe-area-inset-top, 0px))
        max(10px, env(safe-area-inset-right, 0px))
        max(10px, env(safe-area-inset-bottom, 0px))
        max(10px, env(safe-area-inset-left, 0px));
    /* Repli puis chrome Phantom : si max() a 3 args est ignore par la WebView,
       la 1re ligne reste. --app-height a deja retranche le chrome en pixels. */
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px), var(--app-chrome-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Hauteur deja amputee du chrome Phantom : ne pas re-padding le meme inset. */
html.is-phantom-inapp .overlay-dialog-host {
    padding-bottom: 12px;
}

/* Filet pour les navigateurs sans "safe center" (WebKit < iOS 15.6, vieux
   Chrome Android) : une marge auto se resout a 0 des qu'il n'y a plus d'espace
   libre, donc le sommet d'un dialogue trop grand ne sort jamais de la zone
   defilante. Exclus : les calques qui ancrent deja leur dialogue en haut. */
.overlay-dialog-host:not(.overlay-dialog-host--top) > * {
    margin: auto;
}

.giveaway-popup-content {
    color: #ecf0f1;
    margin-bottom: 28px;
    font-size: 1.1em;
    line-height: 1.8;
    max-height: min(50vh, 360px);
    overflow-y: auto;
    text-align: center;
}

.giveaway-reward-line {
    display: block;
}

#giveaway-popup.giveaway-popup--reveal {
    max-width: min(480px, 94vw) !important;
    padding: 24px 16px 28px !important;
}

.giveaway-popup-content--cards {
    max-height: min(68vh, 720px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.giveaway-popup-content--cards .hero-item-detail-scope {
    width: min(330px, 100%);
    flex-shrink: 0;
}

.giveaway-popup-content--cards .hero-item-detail-scope .dofemon-detail-card {
    width: 100%;
    margin-top: 0;
}

@media (max-width: 900px) {
    .giveaway-popup-content--cards .hero-item-detail-scope {
        width: min(430px, 100%);
    }
}

/* =========================================
   POP-UP DE VICTOIRE
   ========================================= */
#victory-popup-overlay {
    /* Geometrie : .fullscreen-layer (100dvh puis --app-height). Ne pas
       redeclarer height/top ici : une regle d'id gagnerait et reintroduirait
       le debordement sous la barre Phantom. */
    box-sizing: border-box;
    padding:
        max(10px, env(safe-area-inset-top, 0px))
        max(10px, env(safe-area-inset-right, 0px))
        max(10px, env(safe-area-inset-bottom, 0px))
        max(10px, env(safe-area-inset-left, 0px));
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px), var(--app-chrome-bottom, 0px));
    background: rgba(0, 0, 0, 0.85);
    z-index: 100000;
    justify-content: center;
    align-items: center;
    /* Le defilement vit dans le corps du popup : sinon un glissement sur le calque
       part en rebond iOS et l'ecran "remonte tout seul". */
    overflow: hidden;
    overscroll-behavior: contain;
    animation: fadeIn 0.3s ease-out;
}

html.is-phantom-inapp #victory-popup-overlay {
    padding-bottom: 12px;
}

#victory-popup {
    display: flex;
    flex-direction: column;
    width: 90%;
    max-width: 800px;
    max-height: 100%;
    min-height: 0;
    box-sizing: border-box;
    padding: 30px;
    background: linear-gradient(135deg, #1e272e 0%, #2c3e50 100%);
    border: 3px solid #f1c40f;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(241, 196, 15, 0.3);
    animation: victoryPopupSlideIn 0.4s ease-out;
}

/* Titre et barre de boutons ancres ; seul le corps defile. */
#victory-popup-title {
    flex: 0 0 auto;
}

#victory-popup-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

#victory-popup-actions {
    flex: 0 0 auto;
}

@keyframes victoryPopupSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.victory-quarter {
    animation: fadeIn 0.5s ease-out;
}

/* Animation de clignotement pour les barres d'XP pleines */
@keyframes xpBarBlink {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7);
    }
    50% {
        box-shadow: 0 0 20px 5px rgba(52, 152, 219, 0.9);
    }
}

.victory-xp-bar-full {
    animation: xpBarBlink 0.8s infinite;
}

/* Animation de progression de la barre d'XP */
@keyframes xpBarGlow {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.victory-xp-bar-glow-animate {
    animation: xpBarGlow 1.5s infinite;
}

/* Style pour les messages de level-up */
.victory-levelup-message {
    background: rgba(230, 126, 34, 0.2);
    border-left: 3px solid #e67e22;
    padding: 10px;
    border-radius: 5px;
    color: #ecf0f1;
    animation: fadeIn 0.3s ease-out;
}

.victory-levelup-message strong {
    color: #e67e22;
}

/* Style pour les drops */
.victory-drop-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: rgba(243, 156, 18, 0.1);
    border-radius: 5px;
    color: #ecf0f1;
    animation: fadeIn 0.3s ease-out;
}

.victory-drop-item:first-child {
    background: rgba(241, 196, 15, 0.2);
    border-left: 3px solid #f1c40f;
    font-weight: bold;
}

/* Responsive pour le pop-up de victoire */
@media (max-width: 768px) {
    #victory-popup {
        width: 100%;
        padding: 16px 14px;
        border-radius: 16px;
    }

    #victory-popup-title {
        font-size: 1.5em !important;
        margin-bottom: 14px !important;
    }

    #victory-popup-content {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto auto auto !important;
        gap: 12px !important;
    }

    /* Une seule zone de defilement sur telephone : le sous-scroll des dofemons
       piegeait le glissement et empechait d'atteindre le bas du popup. */
    #victory-dofemons-xp-container {
        max-height: none !important;
        overflow: visible !important;
    }

    #victory-popup-actions {
        margin-top: 14px !important;
    }

    #victory-popup-ok {
        padding: 12px !important;
    }
    
    .victory-quarter {
        grid-column: 1 !important;
    }
    
    .victory-quarter:nth-child(1) {
        grid-row: 1 !important;
    }
    
    .victory-quarter:nth-child(2) {
        grid-row: 2 !important;
    }
    
    .victory-quarter:nth-child(3) {
        grid-row: 3 !important;
    }
    
    .victory-quarter:nth-child(4) {
        grid-row: 4 !important;
    }
}

/* =========================================
   POP-UP PREMIUM D'ACHIEVEMENT
   ========================================= */
.achievement-unlock-overlay {
    --achievement-accent: #f1c40f;
    --achievement-accent-rgb: 241, 196, 15;
    position: fixed;
    top: var(--app-offset-top, 0px);
    left: 0;
    right: 0;
    height: var(--app-height, 100dvh);
    box-sizing: border-box;
    z-index: 100020;
    align-items: center;
    justify-content: center;
    padding: 24px;
    padding-bottom: max(24px, env(safe-area-inset-bottom), var(--app-chrome-bottom, 0px));
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 38%, rgba(var(--achievement-accent-rgb), 0.2), transparent 32%),
        rgba(3, 7, 16, 0.92);
    backdrop-filter: blur(8px);
    animation: achievementOverlayIn 320ms ease-out both;
}

.achievement-unlock-aurora {
    position: absolute;
    width: min(760px, 92vw);
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        conic-gradient(
            from 20deg,
            transparent,
            rgba(var(--achievement-accent-rgb), 0.16),
            transparent 28%,
            rgba(255, 255, 255, 0.08),
            transparent 60%,
            rgba(var(--achievement-accent-rgb), 0.13),
            transparent
        );
    filter: blur(2px);
    animation: achievementAuroraSpin 18s linear infinite;
}

.achievement-unlock-sparks {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.achievement-unlock-sparks span {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--achievement-accent);
    box-shadow: 0 0 13px 3px rgba(var(--achievement-accent-rgb), 0.7);
    animation: achievementSpark 2.8s ease-in-out infinite;
}

.achievement-unlock-sparks span:nth-child(1) { top: 18%; left: 18%; animation-delay: -0.4s; }
.achievement-unlock-sparks span:nth-child(2) { top: 28%; right: 16%; animation-delay: -1.2s; }
.achievement-unlock-sparks span:nth-child(3) { top: 68%; left: 12%; animation-delay: -2s; }
.achievement-unlock-sparks span:nth-child(4) { right: 13%; bottom: 20%; animation-delay: -0.8s; }
.achievement-unlock-sparks span:nth-child(5) { top: 9%; left: 47%; animation-delay: -1.7s; }
.achievement-unlock-sparks span:nth-child(6) { left: 54%; bottom: 8%; animation-delay: -2.4s; }

.achievement-unlock-popup {
    position: relative;
    box-sizing: border-box;
    width: min(520px, 94vw);
    max-height: calc(var(--app-height, 100dvh) - 36px);
    overflow-y: auto;
    padding: 28px 40px 34px;
    border: 1px solid rgba(var(--achievement-accent-rgb), 0.76);
    border-radius: 28px;
    color: #f8fbff;
    text-align: center;
    background:
        linear-gradient(145deg, rgba(var(--achievement-accent-rgb), 0.15), transparent 37%),
        radial-gradient(circle at 50% 0%, rgba(var(--achievement-accent-rgb), 0.16), transparent 45%),
        linear-gradient(155deg, #192536 0%, #101a29 48%, #080e18 100%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08) inset,
        0 0 48px rgba(var(--achievement-accent-rgb), 0.25),
        0 30px 90px rgba(0, 0, 0, 0.68);
    isolation: isolate;
    animation: achievementPopupIn 620ms cubic-bezier(0.2, 1.25, 0.3, 1) both;
}

.achievement-unlock-popup::before {
    content: "";
    position: absolute;
    inset: 8px;
    z-index: -1;
    border: 1px solid rgba(var(--achievement-accent-rgb), 0.25);
    border-radius: 21px;
    pointer-events: none;
}

.achievement-unlock-popup.is-legendary {
    background:
        linear-gradient(145deg, rgba(241, 196, 15, 0.2), transparent 35%),
        radial-gradient(circle at 50% 0%, rgba(241, 196, 15, 0.23), transparent 45%),
        linear-gradient(155deg, #201d2f 0%, #11172a 52%, #090d17 100%);
}

.achievement-unlock-corner {
    position: absolute;
    top: 20px;
    width: 46px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--achievement-accent));
    opacity: 0.75;
}

.achievement-unlock-corner::after {
    content: "";
    position: absolute;
    top: -3px;
    width: 7px;
    height: 7px;
    border: 1px solid var(--achievement-accent);
    transform: rotate(45deg);
}

.achievement-unlock-corner-left { left: 22px; }
.achievement-unlock-corner-left::after { right: 0; }
.achievement-unlock-corner-right {
    right: 22px;
    transform: scaleX(-1);
}
.achievement-unlock-corner-right::after { right: 0; }

.achievement-unlock-eyebrow {
    margin-bottom: 12px;
    color: var(--achievement-accent);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    text-shadow: 0 0 16px rgba(var(--achievement-accent-rgb), 0.55);
}

.achievement-unlock-badge-stage {
    position: relative;
    display: grid;
    place-items: center;
    width: 184px;
    height: 184px;
    margin: 0 auto 10px;
}

.achievement-unlock-orbit,
.achievement-unlock-rays {
    position: absolute;
    inset: 7px;
    border-radius: 50%;
}

.achievement-unlock-orbit {
    border: 1px solid rgba(var(--achievement-accent-rgb), 0.48);
    box-shadow:
        0 0 24px rgba(var(--achievement-accent-rgb), 0.3),
        0 0 40px rgba(var(--achievement-accent-rgb), 0.18) inset;
    animation: achievementOrbitPulse 2.2s ease-in-out infinite;
}

.achievement-unlock-rays {
    background: repeating-conic-gradient(
        from 0deg,
        rgba(var(--achievement-accent-rgb), 0.16) 0deg 3deg,
        transparent 3deg 19deg
    );
    mask-image: radial-gradient(circle, transparent 0 48%, #000 70%);
    animation: achievementAuroraSpin 24s linear infinite reverse;
}

.achievement-unlock-badge {
    position: relative;
    z-index: 2;
    width: 142px;
    height: 142px;
    object-fit: contain;
    filter:
        drop-shadow(0 0 12px rgba(var(--achievement-accent-rgb), 0.7))
        drop-shadow(0 10px 12px rgba(0, 0, 0, 0.5));
    animation: achievementBadgeReveal 760ms 120ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.achievement-unlock-legendary {
    position: absolute;
    z-index: 3;
    bottom: 5px;
    padding: 4px 11px;
    border: 1px solid rgba(255, 226, 120, 0.75);
    border-radius: 999px;
    color: #211805;
    background: linear-gradient(135deg, #fff0a6, #f1c40f 60%, #d99d08);
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.38);
    font-size: 0.62rem;
    font-weight: 950;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.achievement-unlock-legendary[hidden] {
    display: none;
}

.achievement-unlock-title {
    margin: 0;
    color: #fff;
    font-size: clamp(1.55rem, 4vw, 2rem);
    font-weight: 950;
    letter-spacing: 0.035em;
    line-height: 1.1;
    text-shadow:
        0 2px 2px rgba(0, 0, 0, 0.7),
        0 0 18px rgba(var(--achievement-accent-rgb), 0.35);
}

.achievement-unlock-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 74%;
    margin: 15px auto;
    color: var(--achievement-accent);
    font-size: 0.55rem;
}

.achievement-unlock-divider::before,
.achievement-unlock-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--achievement-accent-rgb), 0.8));
}

.achievement-unlock-divider::after {
    transform: scaleX(-1);
}

.achievement-unlock-message {
    margin: 0 auto;
    max-width: 410px;
    color: #cfd8e6;
    font-size: 0.98rem;
    line-height: 1.55;
}

.achievement-unlock-name {
    margin: 17px auto 22px;
    padding: 10px 16px;
    border: 1px solid rgba(var(--achievement-accent-rgb), 0.38);
    border-radius: 12px;
    color: var(--achievement-accent);
    background: rgba(var(--achievement-accent-rgb), 0.09);
    font-size: 0.92rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.achievement-unlock-button {
    box-sizing: border-box;
    width: min(100%, 260px);
    min-width: 210px;
    padding: 13px 28px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    color: #101620;
    background: linear-gradient(135deg, #fff4b8, var(--achievement-accent) 58%, rgba(var(--achievement-accent-rgb), 0.78));
    box-shadow:
        0 7px 20px rgba(var(--achievement-accent-rgb), 0.3),
        0 1px 0 rgba(255, 255, 255, 0.6) inset;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-align: center;
    text-shadow: none;
    transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

.achievement-unlock-button:hover,
.achievement-unlock-button:focus-visible {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow:
        0 10px 28px rgba(var(--achievement-accent-rgb), 0.45),
        0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

@keyframes achievementOverlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes achievementPopupIn {
    from { opacity: 0; transform: translateY(24px) scale(0.82); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes achievementBadgeReveal {
    from { opacity: 0; transform: scale(0.45) rotate(-12deg); }
    to { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes achievementOrbitPulse {
    0%, 100% { transform: scale(0.96); opacity: 0.58; }
    50% { transform: scale(1.06); opacity: 1; }
}

@keyframes achievementAuroraSpin {
    to { transform: rotate(360deg); }
}

@keyframes achievementSpark {
    0%, 100% { opacity: 0.25; transform: translateY(5px) scale(0.65); }
    50% { opacity: 1; transform: translateY(-8px) scale(1.2); }
}

@media (max-width: 600px), (max-height: 700px) {
    .achievement-unlock-overlay {
        padding: 12px;
        padding-bottom: max(12px, env(safe-area-inset-bottom), var(--app-chrome-bottom, 0px));
    }

    .achievement-unlock-popup {
        width: min(430px, 96vw);
        max-height: calc(var(--app-height, 100dvh) - 20px);
        padding: 22px 22px 25px;
        border-radius: 22px;
    }

    .achievement-unlock-badge-stage {
        width: 148px;
        height: 148px;
        margin-bottom: 5px;
    }

    .achievement-unlock-badge {
        width: 114px;
        height: 114px;
    }

    .achievement-unlock-title {
        font-size: 1.45rem;
    }

    .achievement-unlock-divider {
        margin-block: 11px;
    }

    .achievement-unlock-message {
        font-size: 0.9rem;
    }

    .achievement-unlock-name {
        margin: 13px auto 17px;
        padding: 8px 12px;
        font-size: 0.78rem;
    }

    .achievement-unlock-button {
        min-width: 190px;
        padding: 11px 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .achievement-unlock-overlay,
    .achievement-unlock-popup,
    .achievement-unlock-badge,
    .achievement-unlock-aurora,
    .achievement-unlock-rays,
    .achievement-unlock-orbit,
    .achievement-unlock-sparks span {
        animation: none !important;
    }
}

/* =========================================
   ROUE D'ÉQUIPEMENT ALÉATOIRE
   ========================================= */
.wheel-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.wheel-modal-content {
    background: #2c3e50;
    border: 3px solid #3498db;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.wheel-container {
    position: relative;
    width: 400px;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wheel-arrow {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 40px;
    color: #f1c40f;
    z-index: 10001;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.8);
    animation: arrowPulse 1s infinite;
}

@keyframes arrowPulse {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-5px);
    }
}

.item-wheel {
    width: 350px;
    height: 350px;
    border-radius: 50%;
    position: relative;
    border: 8px solid #f1c40f;
    overflow: hidden;
    background: #1e272e;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 0 40px rgba(241, 196, 15, 0.6), inset 0 0 20px rgba(0, 0, 0, 0.3);
}

/* Images personnalisées pour les roues selon la rareté */
.item-wheel.wheel-common {
    background-image: url('images/ui/wheel_common.png');
}

.item-wheel.wheel-rare {
    background-image: url('images/ui/wheel_rare.png');
}

.item-wheel.wheel-legendary {
    background-image: url('images/ui/wheel_legendary.png');
}

/* Logo Dofemon au centre de la roue */
.item-wheel::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background-image: url('images/logo_dofemon.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 5;
    /* Fallback si l'image n'existe pas - affiche un cercle avec texte */
    background-color: #1e272e;
    border-radius: 50%;
    border: 4px solid #f1c40f;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Texte de fallback si le logo n'existe pas */
.item-wheel::after {
    content: 'DOFEMON';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: bold;
    color: #f1c40f;
    z-index: 6;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    /* Masquer si le logo existe */
    display: none;
}

.item-wheel-section {
    position: absolute;
    width: 75%;
    height: 75%;
    left: 50%;
    top: 50%;
    transform-origin: 0% 0%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.9);
    box-sizing: border-box;
    overflow: hidden;
    /* Triangle de 360/7 ≈ 51.43 degrés (7 sections : weapon + 6 équipements) */
    /* Le triangle part du centre (0%, 0%), va à droite (100%, 0%), puis au point calculé */
    /* Pour couvrir exactement un angle θ, le point en bas est à x = 100 / tan(θ) % */
    /* θ = 51.4286° -> x = 100 / tan(51.4286°) ≈ 79.7% */
    clip-path: polygon(0% 0%, 100% 0%, 79.7% 100%);
    /* Contour noir épais pour chaque section */
    border: 3px solid #000;
    border-left: none;
    border-top: none;
}

/* Contenu centré dans chaque section triangulaire - rapproché du centre */
.item-wheel-section > div {
    position: absolute;
    /* Position plus proche du centre de la roue pour meilleure visibilité */
    /* Le centre est à (50%, 50%), on place le contenu à environ 30% du rayon */
    left: 45%;
    top: 26%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
}

/* Orientation du contenu vers l'extérieur selon la section */
/* Rotation de 90 + (51.43/2) ≈ 115.7° pour orienter le contenu vers l'extérieur */
.item-wheel-section:nth-child(1) > div {
    transform: translate(-50%, -50%) rotate(115.7deg);
}

.item-wheel-section:nth-child(2) > div {
    transform: translate(-50%, -50%) rotate(115.7deg);
}

.item-wheel-section:nth-child(3) > div {
    transform: translate(-50%, -50%) rotate(115.7deg);
}

.item-wheel-section:nth-child(4) > div {
    transform: translate(-50%, -50%) rotate(115.7deg);
}

.item-wheel-section:nth-child(5) > div {
    transform: translate(-50%, -50%) rotate(115.7deg);
}

.item-wheel-section:nth-child(6) > div {
    transform: translate(-50%, -50%) rotate(115.7deg);
}

.item-wheel-section:nth-child(7) > div {
    transform: translate(-50%, -50%) rotate(115.7deg);
}


/* Positionnement des 7 sections en cercle (360/7 ≈ 51.43 degrés chacune) */
/* Chaque section est un triangle de ~51.43 degrés partant du centre */
.item-wheel-section:nth-child(1) {
    background: #9b59b6;
    transform: rotate(0deg);
}

.item-wheel-section:nth-child(1)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #f1c40f;
    pointer-events: none;
    z-index: 10;
}

.item-wheel-section:nth-child(2) {
    background: #1abc9c;
    transform: rotate(51.4286deg);
}

.item-wheel-section:nth-child(2)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #f1c40f;
    pointer-events: none;
    z-index: 10;
}

.item-wheel-section:nth-child(3) {
    background: #3498db;
    transform: rotate(102.8571deg);
}

.item-wheel-section:nth-child(3)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #f1c40f;
    pointer-events: none;
    z-index: 10;
}

.item-wheel-section:nth-child(4) {
    background: #2ecc71;
    transform: rotate(154.2857deg);
}

.item-wheel-section:nth-child(4)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #f1c40f;
    pointer-events: none;
    z-index: 10;
}

.item-wheel-section:nth-child(5) {
    background: #e74c3c;
    transform: rotate(205.7143deg);
}

.item-wheel-section:nth-child(5)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #f1c40f;
    pointer-events: none;
    z-index: 10;
}

.item-wheel-section:nth-child(6) {
    background: #f39c12;
    transform: rotate(257.1429deg);
}

.item-wheel-section:nth-child(6)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #f1c40f;
    pointer-events: none;
    z-index: 10;
}

.item-wheel-section:nth-child(7) {
    background: #16a085;
    transform: rotate(308.5714deg);
}

.item-wheel-section:nth-child(7)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #f1c40f;
    pointer-events: none;
    z-index: 10;
}

.item-wheel-spinning {
    animation: wheelSpin 3s cubic-bezier(0.17, 0.67, 0.12, 0.99) forwards;
}

@keyframes wheelSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(var(--final-rotation, 2160deg));
    }
}

/* La roue tourne, mais les items/noms restent toujours à l'endroit (style grande roue).
   On contre-tourne le contenu exactement à l'inverse de la roue, avec la même durée et
   la même courbe d'accélération, pour annuler la rotation visuelle du texte/icône. */
.item-wheel-spinning .wheel-section-content {
    animation: wheelSectionCounterSpin 3s cubic-bezier(0.17, 0.67, 0.12, 0.99) forwards;
}

@keyframes wheelSectionCounterSpin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(calc(-1 * var(--final-rotation, 2160deg)));
    }
}

.wheel-section-label {
    font-size: 13px;
    margin-top: 8px;
    text-align: center;
    font-weight: normal;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

/* Clean 7-slot equipment wheel layout. */
.item-wheel.wheel-common,
.item-wheel.wheel-rare,
.item-wheel.wheel-legendary {
    background-image:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.16) 0 16%, transparent 17%),
        repeating-conic-gradient(from calc(var(--wheel-spin-offset, 0deg) - var(--segment-angle, 51.4286deg) / 2), rgba(255, 255, 255, 0.24) 0 1deg, transparent 1deg var(--segment-angle, 51.4286deg)),
        conic-gradient(from var(--wheel-spin-offset, 0deg), var(--wheel-gradient));
    background-color: #1d2730;
}

.item-wheel.wheel-common {
    --wheel-ring-color: #f1c40f;
    --wheel-glow-color: rgba(241, 196, 15, 0.62);
}

.item-wheel.wheel-rare {
    --wheel-ring-color: #4aa9ff;
    --wheel-glow-color: rgba(74, 169, 255, 0.62);
}

.item-wheel.wheel-legendary {
    --wheel-ring-color: #f3c64b;
    --wheel-glow-color: rgba(243, 198, 75, 0.78);
}

.item-wheel {
    border-color: var(--wheel-ring-color, #f1c40f);
    box-shadow:
        0 0 38px var(--wheel-glow-color, rgba(241, 196, 15, 0.62)),
        inset 0 0 26px rgba(0, 0, 0, 0.42);
}

.item-wheel::before {
    width: 116px;
    height: 116px;
    border-color: var(--wheel-ring-color, #f1c40f);
    background-color: #17202a;
    box-shadow:
        0 0 0 8px rgba(23, 32, 42, 0.86),
        0 0 18px rgba(0, 0, 0, 0.55),
        inset 0 0 12px rgba(0, 0, 0, 0.6);
}

.item-wheel .item-wheel-section {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    left: 0;
    top: 0;
    transform-origin: 50% 50%;
    transform: none;
    display: block;
    clip-path: none;
    border: 0;
    background: transparent;
    overflow: visible;
    pointer-events: none;
}

.item-wheel .item-wheel-section::after {
    display: none;
}

.item-wheel .item-wheel-section > div {
    position: absolute;
    left: var(--slot-x, 50%);
    top: var(--slot-y, 50%);
    width: 88px;
    min-height: 92px;
    transform: translate(-50%, -50%);
    transform-origin: 50% 50%;
    display: block;
    text-align: center;
    z-index: 2;
}

.wheel-section-face {
    width: 100%;
    min-height: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    text-align: center;
    transform: none;
    transform-origin: 50% 50%;
}

.wheel-section-icon {
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.52));
}

.item-wheel .wheel-section-label {
    width: 96px;
    min-height: 30px;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1px;
    color: #ffffff;
    font-size: 10.5px;
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: normal;
    overflow-wrap: anywhere;
    text-shadow:
        0 2px 3px rgba(0, 0, 0, 0.95),
        0 0 8px rgba(0, 0, 0, 0.65);
}

.item-wheel .wheel-section-label span {
    display: block;
}

@media (max-width: 520px) {
    .wheel-modal-content {
        padding: 28px 18px;
    }

    .wheel-container {
        width: 330px;
        height: 330px;
    }

    .item-wheel {
        width: 300px;
        height: 300px;
        border-width: 7px;
    }

    .item-wheel::before {
        width: 98px;
        height: 98px;
    }

    .item-wheel .item-wheel-section > div {
        width: 74px;
        min-height: 82px;
        transform: translate(-50%, -50%);
    }

    .wheel-section-icon {
        width: 48px;
        height: 48px;
    }

    .item-wheel .wheel-section-label {
        width: 82px;
        font-size: 9px;
    }
}

/* Premium equipment wheel refresh. */
#item-wheel-modal {
    background:
        radial-gradient(circle at 50% 24%, rgba(244, 199, 80, 0.2), transparent 34%),
        radial-gradient(circle at 78% 76%, rgba(74, 169, 255, 0.16), transparent 30%),
        rgba(3, 7, 12, 0.88);
    backdrop-filter: blur(8px);
}

#item-wheel-modal .wheel-modal-content {
    width: min(94vw, 1060px);
    max-height: 92vh;
    overflow-y: auto;
    padding: 28px;
    gap: 18px;
    border: 1px solid rgba(244, 199, 80, 0.62);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(26, 34, 48, 0.96), rgba(8, 13, 21, 0.98)),
        radial-gradient(circle at 50% 0%, rgba(244, 199, 80, 0.2), transparent 42%);
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.72),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.wheel-modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.wheel-modal-title {
    color: #f5d77a;
    font-size: 22px;
    line-height: 1.1;
    font-weight: 900;
    text-transform: uppercase;
    text-shadow: 0 0 18px rgba(245, 215, 122, 0.34);
}

.wheel-modal-status {
    min-height: 18px;
    color: #b8cad8;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

#item-wheel-modal .wheel-container {
    width: 440px;
    height: 440px;
    isolation: isolate;
    /* La roue est un carré de 384px qui tourne : ses coins balaient jusqu'à ~271px
       de rayon et débordaient du conteneur, ce qui gonflait la hauteur de défilement
       de .wheel-modal-content et faisait clignoter la scrollbar (roue qui tremble).
       `overflow: clip` empêche ce débordement de remonter au conteneur de défilement ;
       la marge laisse passer la flèche et le halo (les coins balayés sont transparents). */
    overflow: clip;
    overflow-clip-margin: 80px;
}

#item-wheel-modal .wheel-container::before {
    content: '';
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    background:
        conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.16), transparent, rgba(244, 199, 80, 0.16), transparent),
        radial-gradient(circle, transparent 58%, rgba(255, 255, 255, 0.1) 59%, transparent 62%);
    filter: blur(1px);
    opacity: 0.85;
    pointer-events: none;
    z-index: -1;
}

#item-wheel-modal .wheel-container::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 126px;
    height: 126px;
    transform: translate(-50%, -50%);
    z-index: 8;
    border: 3px solid var(--wheel-ring-color, #ffd866);
    border-radius: 50%;
    background-color: #0c131d;
    background-image: url('images/logo_dofemon.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    box-shadow:
        0 0 0 9px rgba(9, 14, 21, 0.86),
        0 0 28px var(--wheel-glow-color, rgba(255, 216, 102, 0.55)),
        inset 0 0 18px rgba(0, 0, 0, 0.66);
    pointer-events: none;
}

#item-wheel-modal .wheel-arrow {
    top: -7px;
    width: 0;
    height: 0;
    color: transparent;
    border-left: 19px solid transparent;
    border-right: 19px solid transparent;
    border-top: 32px solid #ffd866;
    filter: drop-shadow(0 0 12px rgba(255, 216, 102, 0.8));
}

#item-wheel-modal .wheel-arrow::after {
    content: '';
    position: absolute;
    left: -9px;
    top: -31px;
    width: 18px;
    height: 8px;
    border-radius: 999px;
    background: #fff2b3;
}

#item-wheel-modal .item-wheel {
    width: 384px;
    height: 384px;
    border-width: 10px;
    background-image:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.22) 0 14%, rgba(9, 14, 21, 0.76) 15% 17%, transparent 18%),
        repeating-conic-gradient(from calc(var(--wheel-spin-offset, 0deg) - var(--segment-angle, 51.4286deg) / 2), rgba(255, 255, 255, 0.34) 0 0.9deg, rgba(0, 0, 0, 0.18) 0.9deg 1.8deg, transparent 1.8deg var(--segment-angle, 51.4286deg)),
        conic-gradient(from var(--wheel-spin-offset, 0deg), var(--wheel-gradient));
    box-shadow:
        0 0 0 6px rgba(255, 255, 255, 0.06),
        0 0 42px var(--wheel-glow-color, rgba(241, 196, 15, 0.62)),
        0 22px 56px rgba(0, 0, 0, 0.62),
        inset 0 0 34px rgba(0, 0, 0, 0.5);
}

#item-wheel-modal .item-wheel.wheel-common {
    --wheel-ring-color: #8fd26d;
    --wheel-glow-color: rgba(143, 210, 109, 0.52);
}

#item-wheel-modal .item-wheel.wheel-rare {
    --wheel-ring-color: #54b6ff;
    --wheel-glow-color: rgba(84, 182, 255, 0.62);
}

#item-wheel-modal .item-wheel.wheel-legendary {
    --wheel-ring-color: #ffd866;
    --wheel-glow-color: rgba(255, 216, 102, 0.82);
}

#item-wheel-modal .item-wheel::before {
    display: none;
    width: 126px;
    height: 126px;
    border-width: 3px;
    border-color: var(--wheel-ring-color, #ffd866);
    background-color: #0c131d;
    box-shadow:
        0 0 0 9px rgba(9, 14, 21, 0.86),
        0 0 28px var(--wheel-glow-color, rgba(255, 216, 102, 0.55)),
        inset 0 0 18px rgba(0, 0, 0, 0.66);
}

#item-wheel-modal .item-wheel::after {
    content: attr(data-rarity-label);
    display: none;
    top: calc(50% + 49px);
    color: var(--wheel-ring-color, #ffd866);
    font-size: 11px;
    letter-spacing: 0;
    text-transform: uppercase;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.95);
}

#item-wheel-modal .item-wheel .item-wheel-section > div {
    left: var(--slot-x, 50%);
    top: var(--slot-y, 50%);
    width: 86px;
    min-height: 92px;
    padding: 0;
    border-radius: 8px;
    transform: translate(-50%, -50%);
    transition: filter 0.25s ease;
}

#item-wheel-modal .wheel-section-icon {
    width: 54px;
    height: 54px;
    padding: 4px;
    border-radius: 50%;
    background: rgba(5, 9, 14, 0.34);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.12),
        0 7px 14px rgba(0, 0, 0, 0.42);
}

#item-wheel-modal .item-wheel .wheel-section-label {
    width: 86px;
    color: #fff7df;
    font-size: 8.5px;
    line-height: 1.05;
    font-weight: 900;
}

#item-wheel-modal .item-wheel-section.is-winning .wheel-section-face {
    filter:
        drop-shadow(0 0 12px rgba(255, 255, 255, 0.88))
        drop-shadow(0 0 18px var(--wheel-ring-color, #ffd866));
}

#item-wheel-modal .item-wheel-section.is-winning .wheel-section-icon {
    background: rgba(255, 255, 255, 0.18);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.34),
        0 0 18px var(--wheel-ring-color, #ffd866);
}

.wheel-reveal {
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding-top: 6px;
    animation: wheelRevealIn 0.35s ease-out both;
}

.wheel-result-title {
    color: #f5d77a;
    font-size: 18px;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
    text-shadow: 0 0 16px rgba(245, 215, 122, 0.35);
}

.wheel-result-card {
    width: min(330px, 100%);
    max-height: min(620px, calc(100vh - 248px));
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(245, 215, 122, 0.58) rgba(255, 255, 255, 0.08);
}

.wheel-result-card::-webkit-scrollbar {
    width: 5px;
}

.wheel-result-card::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
}

.wheel-result-card::-webkit-scrollbar-thumb {
    background: rgba(245, 215, 122, 0.58);
    border-radius: 999px;
}

.wheel-result-card .dofemon-detail-card {
    width: 100%;
    margin: 0 auto;
}

#item-wheel-modal .dofemon-detail-card {
    --dofemon-card-ink: #f7fbff;
    --dofemon-card-muted: rgba(236, 246, 255, 0.72);
    --dofemon-card-panel: rgba(14, 26, 36, 0.78);
    --dofemon-card-trim: color-mix(in srgb, var(--dofemon-card-color, #8fb8c8) 76%, white 24%);
    --dofemon-theme-color: var(--dofemon-card-color, #8fb8c8);
    --dofemon-theme-bright: color-mix(in srgb, var(--dofemon-theme-color) 68%, white 32%);
    --dofemon-theme-soft: color-mix(in srgb, var(--dofemon-theme-color) 34%, transparent);
    --dofemon-frame-a: #53616e;
    --dofemon-frame-b: #23313a;
    --dofemon-frame-c: #0c141c;
    --dofemon-card-bg-url: url("images/backgrounds/normal.png");
    --dofemon-card-art-position: center 50%;
    width: min(100%, 330px);
    margin: 0 auto;
    color: var(--dofemon-card-ink);
    filter: drop-shadow(0 24px 36px rgba(0, 0, 0, 0.38));
}

#item-wheel-modal .dofemon-card-frame {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    padding: 10px;
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.22), transparent 18%),
        radial-gradient(circle at 20% 14%, rgba(255, 255, 255, 0.28), transparent 22%),
        radial-gradient(circle at 82% 18%, var(--dofemon-theme-soft), transparent 32%),
        radial-gradient(circle at 50% 100%, color-mix(in srgb, var(--dofemon-theme-color) 22%, transparent), transparent 38%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 16px),
        linear-gradient(165deg, var(--dofemon-frame-a), var(--dofemon-frame-b) 52%, var(--dofemon-frame-c));
    border: 2px solid color-mix(in srgb, var(--dofemon-theme-bright) 78%, white 22%);
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.12),
        inset 0 -28px 45px rgba(0, 0, 0, 0.34),
        0 0 34px color-mix(in srgb, var(--dofemon-theme-color) 28%, transparent),
        0 18px 38px rgba(0, 0, 0, 0.4);
}

#item-wheel-modal .dofemon-card-frame::before {
    content: "";
    position: absolute;
    inset: 8px;
    z-index: 1;
    border: 1px solid color-mix(in srgb, var(--dofemon-theme-bright) 24%, transparent);
    border-radius: 10px;
    pointer-events: none;
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--dofemon-theme-color) 14%, transparent),
        inset 0 0 22px color-mix(in srgb, var(--dofemon-theme-color) 10%, transparent);
}

#item-wheel-modal .dofemon-card-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0.5;
    background:
        linear-gradient(112deg, transparent 0 28%, rgba(255, 255, 255, 0.17) 39%, transparent 51%),
        radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.22), transparent 18%),
        radial-gradient(circle at 12% 88%, color-mix(in srgb, var(--dofemon-theme-color) 22%, transparent), transparent 18%);
}

#item-wheel-modal .dofemon-card-top,
#item-wheel-modal .dofemon-card-art,
#item-wheel-modal .dofemon-card-body,
#item-wheel-modal .dofemon-card-footer {
    position: relative;
    z-index: 3;
}

#item-wheel-modal .equipment-card-top {
    min-height: 38px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 8px;
}

#item-wheel-modal .equipment-card-top--single {
    grid-template-columns: 1fr;
}

#item-wheel-modal .dofemon-card-top-badge,
#item-wheel-modal .dofemon-card-name {
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--dofemon-card-color, #8fb8c8) 62%, white 20%);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.18)),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0)),
        rgba(7, 17, 25, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 5px 12px rgba(0, 0, 0, 0.22);
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
}

#item-wheel-modal .dofemon-card-top-badge,
#item-wheel-modal .dofemon-card-name {
    min-width: 0;
    padding: 9px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#item-wheel-modal .dofemon-card-name {
    color: color-mix(in srgb, var(--dofemon-card-color, #8fb8c8) 78%, white 22%);
    text-shadow:
        0 0 10px color-mix(in srgb, var(--dofemon-card-color, #8fb8c8) 46%, transparent),
        0 2px 8px rgba(0, 0, 0, 0.86);
}

#item-wheel-modal .equipment-card-top--single .equipment-card-name {
    text-align: center;
}

#item-wheel-modal .equipment-card-art {
    height: 206px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 9px;
    overflow: hidden;
    border: 2px solid color-mix(in srgb, var(--dofemon-theme-bright) 58%, transparent);
    border-radius: 10px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--dofemon-theme-color) 12%, transparent), rgba(0, 0, 0, 0.16)),
        radial-gradient(circle at 50% 48%, color-mix(in srgb, var(--dofemon-theme-color) 18%, transparent), transparent 36%),
        var(--item-card-bg-url),
        linear-gradient(155deg, var(--dofemon-frame-a), var(--dofemon-frame-b) 52%, var(--dofemon-frame-c));
    background-size: cover;
    background-position: center;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.14),
        inset 0 -46px 52px rgba(6, 20, 36, 0.56),
        0 0 18px color-mix(in srgb, var(--dofemon-theme-color) 18%, transparent);
}

#item-wheel-modal .equipment-card-art::before,
#item-wheel-modal .equipment-card-art::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

#item-wheel-modal .equipment-card-art::before {
    inset: 0;
    opacity: 0.62;
    background:
        repeating-radial-gradient(ellipse at 50% 48%, transparent 0 24px, rgba(255, 255, 255, 0.16) 25px 27px, transparent 28px 44px);
}

#item-wheel-modal .equipment-card-art::after {
    content: none;
}

#item-wheel-modal .dofemon-card-art-glow {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--dofemon-card-color, #8fb8c8) 42%, transparent), transparent 68%);
    filter: blur(8px);
}

#item-wheel-modal .equipment-card-image {
    position: relative;
    z-index: 2;
    width: 132px;
    height: 132px;
    object-fit: contain;
    filter:
        drop-shadow(0 16px 16px rgba(0, 0, 0, 0.5))
        drop-shadow(0 0 18px color-mix(in srgb, var(--dofemon-theme-color) 42%, transparent));
}

#item-wheel-modal .equipment-card-fallback {
    position: relative;
    z-index: 2;
    display: none;
    align-items: center;
    justify-content: center;
    width: 132px;
    height: 132px;
    font-size: 58px;
}

#item-wheel-modal .equipment-card-body {
    display: grid;
    gap: 8px;
    margin-top: 9px;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--dofemon-theme-bright) 20%, transparent);
    border-radius: 10px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--dofemon-theme-bright) 8%, transparent), rgba(5, 16, 28, 0.08)),
        color-mix(in srgb, var(--dofemon-frame-b) 58%, rgba(8, 18, 28, 0.82));
}

#item-wheel-modal .equipment-card-stat-list {
    display: grid;
    gap: 6px;
}

#item-wheel-modal .equipment-card-stat-row {
    --equipment-stat-color: #c6ced6;
    min-height: 34px;
    display: grid;
    grid-template-columns: minmax(86px, 0.9fr) minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid color-mix(in srgb, var(--equipment-stat-color) 38%, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--equipment-stat-color) 18%, transparent), rgba(255, 255, 255, 0.03)),
        rgba(4, 12, 18, 0.66);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#item-wheel-modal .equipment-card-stat-row--pm { --equipment-stat-color: #3ee37c; }
#item-wheel-modal .equipment-card-stat-row--hp { --equipment-stat-color: #ff6078; }
#item-wheel-modal .equipment-card-stat-row--force { --equipment-stat-color: #ffd447; }
#item-wheel-modal .equipment-card-stat-row--init { --equipment-stat-color: #42a5ff; }

#item-wheel-modal .equipment-card-stat-row span {
    color: color-mix(in srgb, var(--equipment-stat-color) 60%, white 40%);
    font-size: 10px;
    font-weight: 1000;
    text-transform: uppercase;
}

#item-wheel-modal .equipment-card-stat-row strong {
    justify-self: end;
    color: color-mix(in srgb, var(--equipment-stat-color) 82%, white 18%);
    font-size: 15px;
    line-height: 1;
    text-shadow: 0 0 8px color-mix(in srgb, var(--equipment-stat-color) 34%, transparent);
}

#item-wheel-modal .dofemon-card-section-title {
    color: color-mix(in srgb, var(--dofemon-card-color, #8fb8c8) 36%, white 64%);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

#item-wheel-modal .equipment-card-spells {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 6px;
}

#item-wheel-modal .equipment-card-spell {
    --spell-type-color: var(--dofemon-card-color, #8fb8c8);
    min-width: 0;
    height: 32px;
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    padding: 0 7px;
    position: relative;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--spell-type-color) 82%, white 18%);
    border-radius: 7px;
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--spell-type-color) 24%, transparent), rgba(255, 255, 255, 0.03)),
        rgba(5, 15, 24, 0.88);
    color: #f8fcff;
    cursor: default;
    font: inherit;
    text-align: left;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 12px color-mix(in srgb, var(--spell-type-color) 44%, transparent);
}

#item-wheel-modal .dofemon-card-spell--fire { --spell-type-color: #ff7045; }
#item-wheel-modal .dofemon-card-spell--water { --spell-type-color: #39a8ff; }
#item-wheel-modal .dofemon-card-spell--grass { --spell-type-color: #42d678; }
#item-wheel-modal .dofemon-card-spell--electric { --spell-type-color: #ffe04f; }
#item-wheel-modal .dofemon-card-spell--wind { --spell-type-color: #9bdcff; }
#item-wheel-modal .dofemon-card-spell--ground { --spell-type-color: #c79a62; }
#item-wheel-modal .dofemon-card-spell--psychic { --spell-type-color: #c77dff; }
#item-wheel-modal .dofemon-card-spell--dark { --spell-type-color: #8d7bff; }
#item-wheel-modal .dofemon-card-spell--light { --spell-type-color: #ffe9a6; }
#item-wheel-modal .dofemon-card-spell--steel { --spell-type-color: #b9c7d4; }
#item-wheel-modal .dofemon-card-spell--dragon { --spell-type-color: #ff9d4d; }
#item-wheel-modal .dofemon-card-spell--normal { --spell-type-color: #c6ced6; }

#item-wheel-modal .equipment-card-spell.is-selected::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 0 999px 999px 0;
    background: var(--spell-type-color);
    box-shadow: 0 0 8px var(--spell-type-color);
}

#item-wheel-modal .dofemon-card-spell-index {
    width: 20px;
    height: 20px;
    justify-self: center;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--spell-type-color) 26%, rgba(255, 255, 255, 0.1));
    border: 1px solid color-mix(in srgb, var(--spell-type-color) 44%, transparent);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
}

#item-wheel-modal .dofemon-card-spell-index--emblem {
    width: 26px;
    height: 26px;
    padding: 0;
    overflow: hidden;
    border-radius: 6px;
    background: rgba(4, 8, 12, 0.64);
}

#item-wheel-modal .dofemon-card-spell-index--emblem img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    border-radius: inherit;
}

#item-wheel-modal .dofemon-card-spell-name {
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#item-wheel-modal .dofemon-card-spell-type {
    color: color-mix(in srgb, var(--spell-type-color) 72%, white 28%);
    font-size: 8px;
    font-weight: 900;
}

#item-wheel-modal .equipment-card-spell-detail {
    min-height: 142px;
    display: grid;
    gap: 6px;
    margin-top: 7px;
    padding: 9px;
    border: 1px solid color-mix(in srgb, var(--dofemon-theme-bright) 18%, transparent);
    border-radius: 8px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--dofemon-theme-bright) 8%, transparent), rgba(0, 0, 0, 0.08)),
        rgba(2, 8, 14, 0.44);
    color: rgba(235, 245, 255, 0.86);
    font-size: 10px;
    line-height: 1.35;
    box-shadow: inset 0 0 18px color-mix(in srgb, var(--dofemon-theme-color) 5%, transparent);
}

#item-wheel-modal .dofemon-card-spell-detail-header {
    min-width: 0;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

#item-wheel-modal .dofemon-card-spell-emblem {
    width: 38px;
    height: 38px;
    justify-self: center;
    align-self: center;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #081018;
    font-size: 17px;
    font-weight: 1000;
    line-height: 1;
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.2) 31%, transparent 35%),
        linear-gradient(145deg, color-mix(in srgb, var(--spell-type-color) 76%, white 24%), color-mix(in srgb, var(--spell-type-color) 72%, black 28%));
    border: 1px solid color-mix(in srgb, var(--spell-type-color) 78%, white 22%);
}

#item-wheel-modal .dofemon-card-spell-emblem--image {
    padding: 0;
    overflow: hidden;
    color: transparent;
    background: rgba(4, 8, 12, 0.64);
}

#item-wheel-modal .dofemon-card-spell-emblem--image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    border-radius: inherit;
}

#item-wheel-modal .dofemon-card-spell-detail-name {
    min-width: 0;
    overflow: hidden;
    color: color-mix(in srgb, var(--spell-type-color) 78%, white 22%);
    font-size: 20px;
    font-weight: 1000;
    line-height: 1.2;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#item-wheel-modal .dofemon-card-spell-detail-type {
    min-width: 48px;
    padding: 5px 7px;
    border: 1px solid color-mix(in srgb, var(--spell-type-color) 40%, rgba(255, 255, 255, 0.12));
    border-radius: 6px;
    color: color-mix(in srgb, var(--spell-type-color) 78%, white 22%);
    font-size: 9px;
    font-weight: 1000;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    background: color-mix(in srgb, var(--spell-type-color) 14%, rgba(0, 0, 0, 0.42));
}

#item-wheel-modal .dofemon-card-spell-detail-primary,
#item-wheel-modal .dofemon-card-spell-detail-secondary {
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.045);
}

#item-wheel-modal .dofemon-card-spell-detail-primary {
    color: rgba(255, 255, 255, 0.96);
    font-size: 14px;
    font-weight: 900;
    text-align: center;
}

#item-wheel-modal .dofemon-card-spell-detail-primary--damage {
    color: color-mix(in srgb, var(--spell-type-color) 78%, white 22%);
}

#item-wheel-modal .dofemon-card-spell-detail-secondary,
#item-wheel-modal .dofemon-card-spell-detail-description p {
    color: rgba(230, 241, 249, 0.86);
    font-size: 10px;
    line-height: 1.3;
    text-align: center;
}

#item-wheel-modal .dofemon-card-spell-detail-metrics {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(52px, auto);
    gap: 5px;
}

#item-wheel-modal .dofemon-card-spell-detail-metrics span {
    min-width: 0;
    padding: 5px 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow-wrap: anywhere;
    color: rgba(240, 247, 255, 0.9);
    font-size: 9px;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
    background: rgba(0, 0, 0, 0.24);
}

#item-wheel-modal .dofemon-card-spell-detail-description {
    padding-top: 2px;
    border-top: 1px solid color-mix(in srgb, var(--dofemon-theme-bright) 16%, transparent);
}

#item-wheel-modal .dofemon-card-spell-detail-description span {
    color: color-mix(in srgb, var(--dofemon-theme-bright) 42%, white 58%);
    font-size: 9px;
    font-weight: 1000;
    text-transform: uppercase;
}

#item-wheel-modal .equipment-card-footer {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 8px;
    margin-top: 9px;
}

#item-wheel-modal .equipment-card-rarity {
    display: flex;
    align-items: flex-end;
}

#item-wheel-modal .equipment-card-rarity span {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    margin-left: 0;
    border-radius: 50%;
    color: #0a1016;
    font-size: 13px;
    font-weight: 1000;
    background: color-mix(in srgb, var(--dofemon-theme-bright) 76%, white 24%);
}

#item-wheel-modal .dofemon-card-flavor {
    min-width: 0;
    color: var(--dofemon-card-muted);
    font-size: 10px;
    line-height: 1.3;
}

.wheel-result-actions {
    display: flex;
    justify-content: center;
}

.wheel-result-continue {
    min-width: 180px;
    border-color: #d7ad45;
    background: linear-gradient(180deg, #f4c750, #986d1b);
    color: #14100a;
    font-weight: 900;
    text-transform: uppercase;
    text-shadow: none;
    box-shadow: 0 10px 26px rgba(244, 199, 80, 0.24);
}

.wheel-result-visible .wheel-modal-content {
    display: grid;
    grid-template-columns: minmax(360px, 430px) minmax(280px, 1fr);
    align-items: center;
    column-gap: 30px;
}

.wheel-result-visible .wheel-modal-header {
    grid-column: 1 / -1;
}

.wheel-result-visible .wheel-container {
    justify-self: center;
}

.wheel-result-visible .wheel-reveal {
    display: flex !important;
}

@keyframes wheelRevealIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 900px) {
    #item-wheel-modal .wheel-modal-content,
    .wheel-result-visible .wheel-modal-content {
        display: flex;
        width: min(94vw, 560px);
        padding: 22px 16px;
    }

    #item-wheel-modal .wheel-container {
        width: 350px;
        height: 350px;
    }

    #item-wheel-modal .item-wheel {
        width: 306px;
        height: 306px;
        border-width: 8px;
    }

    #item-wheel-modal .wheel-container::after,
    #item-wheel-modal .item-wheel::before {
        width: 96px;
        height: 96px;
    }

    #item-wheel-modal .item-wheel::after {
        top: calc(50% + 37px);
        font-size: 9px;
    }

    #item-wheel-modal .item-wheel .item-wheel-section > div {
        left: var(--slot-x, 50%);
        top: var(--slot-y, 50%);
        width: 72px;
        min-height: 82px;
        transform: translate(-50%, -50%);
    }

    #item-wheel-modal .wheel-section-icon {
        width: 48px;
        height: 48px;
        padding: 4px;
    }

    #item-wheel-modal .item-wheel .wheel-section-label {
        width: 72px;
        font-size: 7.6px;
    }

    .wheel-result-card {
        width: min(310px, 100%);
    }
}

@media (max-width: 420px) {
    #item-wheel-modal .wheel-container {
        width: 310px;
        height: 310px;
    }

    #item-wheel-modal .item-wheel {
        width: 274px;
        height: 274px;
    }

    #item-wheel-modal .item-wheel .item-wheel-section > div {
        left: var(--slot-x, 50%);
        top: var(--slot-y, 50%);
        width: 66px;
        min-height: 76px;
        transform: translate(-50%, -50%);
    }

    #item-wheel-modal .wheel-container::after {
        width: 88px;
        height: 88px;
    }

    #item-wheel-modal .wheel-section-icon {
        width: 42px;
        height: 42px;
    }

    #item-wheel-modal .item-wheel .wheel-section-label {
        width: 66px;
        font-size: 7px;
    }
}

@media (max-width: 600px) {
    #item-wheel-modal.wheel-result-visible .wheel-container {
        display: none;
    }

    #item-wheel-modal.wheel-result-visible .wheel-modal-content {
        justify-content: flex-start;
        gap: 14px;
    }

    #item-wheel-modal.wheel-result-visible .wheel-result-card {
        max-height: min(560px, calc(100vh - 238px));
    }
}

/* =========================================
   MYSTERY BOX SLOT MACHINE
   ========================================= */
#mystery-box-modal {
    background:
        radial-gradient(circle at 50% 20%, rgba(241, 196, 15, 0.24), transparent 34%),
        radial-gradient(circle at 78% 76%, rgba(52, 152, 219, 0.16), transparent 30%),
        rgba(3, 7, 12, 0.88);
    backdrop-filter: blur(7px);
}

#mystery-box-modal .wheel-modal-content {
    width: min(94vw, 860px);
    max-height: 92vh;
    overflow-y: auto;
    padding: 30px;
    gap: 16px;
    border: 1px solid rgba(241, 196, 15, 0.64);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(31, 41, 54, 0.98), rgba(9, 14, 21, 0.98)),
        radial-gradient(circle at 50% 0%, rgba(241, 196, 15, 0.2), transparent 42%);
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.72),
        0 0 36px rgba(241, 196, 15, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.mb-result-popup {
    width: min(100%, 390px);
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-top: 4px;
    animation: wheelRevealIn 0.35s ease-out both;
}

.mb-result-title {
    color: #f5d77a;
    font-size: 22px;
    line-height: 1.1;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
    text-shadow: 0 0 18px rgba(245, 215, 122, 0.38);
}

.mb-result-subtitle {
    max-width: 360px;
    color: #f7fbff;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 800;
    text-align: center;
}

.mb-result-card {
    width: min(330px, 100%);
    max-height: min(620px, calc(100vh - 298px));
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(245, 215, 122, 0.58) rgba(255, 255, 255, 0.08);
}

.mb-result-card::-webkit-scrollbar {
    width: 5px;
}

.mb-result-card::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.mb-result-card::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(245, 215, 122, 0.58);
}

.mb-result-card .dofemon-detail-card {
    width: 100%;
    margin: 0 auto;
}

.mb-result-actions {
    display: flex;
    justify-content: center;
}

.mb-result-continue {
    min-width: 180px;
    border-color: #d7ad45;
    background: linear-gradient(180deg, #f4c750, #986d1b);
    color: #14100a;
    font-weight: 900;
    text-transform: uppercase;
    text-shadow: none;
    box-shadow: 0 10px 26px rgba(244, 199, 80, 0.24);
}

#mystery-box-modal.mb-result-visible .wheel-modal-content {
    display: flex;
    width: min(94vw, 460px);
    min-width: 0 !important;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
}

#mystery-box-modal.mb-result-visible > .wheel-modal-content > div:first-child,
#mystery-box-modal.mb-result-visible > .wheel-modal-content > .mb-modal-heading,
#mystery-box-modal.mb-result-visible .mb-slot-outer,
#mystery-box-modal.mb-result-visible #mb-result-text {
    display: none;
}

#mystery-box-modal.mb-result-visible .mb-result-popup {
    display: flex !important;
}

.mb-slot-outer {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.mb-slot-pointer-top,
.mb-slot-pointer-bot {
    font-size: 26px;
    color: #f1c40f;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.8);
    animation: arrowPulse 1s infinite;
    line-height: 1;
}

.mb-slot-window {
    width: 330px;
    height: 130px;
    overflow: hidden;
    border: 3px solid #f1c40f;
    border-radius: 12px;
    background: #1a1a2e;
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.3), inset 0 0 15px rgba(0, 0, 0, 0.5);
    position: relative;
}

.mb-slot-window::before,
.mb-slot-window::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 55px;
    z-index: 2;
    pointer-events: none;
}

.mb-slot-window::before {
    left: 0;
    background: linear-gradient(to right, rgba(26, 26, 46, 0.92), transparent);
}

.mb-slot-window::after {
    right: 0;
    background: linear-gradient(to left, rgba(26, 26, 46, 0.92), transparent);
}

.mb-slot-center-highlight {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    width: 110px;
    height: 100%;
    border-left: 2px solid rgba(241, 196, 15, 0.5);
    border-right: 2px solid rgba(241, 196, 15, 0.5);
    pointer-events: none;
    z-index: 3;
    background: rgba(241, 196, 15, 0.06);
}

.mb-slot-strip {
    display: flex;
    flex-direction: row;
    height: 130px;
    will-change: transform;
}

.mb-slot-item {
    width: 110px;
    height: 130px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 4px;
    box-sizing: border-box;
}

.mb-slot-item img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.mb-slot-item-name {
    font-size: 10px;
    text-align: center;
    color: #ccc;
    line-height: 1.2;
    max-width: 100px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.mb-slot-item.rarity-rare {
    background: linear-gradient(to bottom, rgba(52, 152, 219, 0.15), transparent);
}

.mb-slot-item.rarity-legendary {
    background: linear-gradient(to bottom, rgba(241, 196, 15, 0.18), transparent);
}

.mystery-box-shop-item {
    border: 2px solid #f1c40f !important;
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.08) 0%, rgba(44, 62, 80, 0.95) 100%) !important;
    box-shadow: 0 0 12px rgba(241, 196, 15, 0.2);
}

.btn-mystery-box-free {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.4);
    transition: transform 0.1s, box-shadow 0.1s;
}

.btn-mystery-box-free:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.6);
}

.btn-mystery-box-paid {
    background: linear-gradient(135deg, #e67e22, #f39c12);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.4);
    transition: transform 0.1s, box-shadow 0.1s;
}

.btn-mystery-box-paid:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.6);
}

.mb-free-timer {
    font-size: 11px;
    color: #95a5a6;
    text-align: right;
    margin-top: 3px;
}

@media (max-width: 820px) {
    #mystery-box-modal .wheel-modal-content,
    #mystery-box-modal.mb-result-visible .wheel-modal-content {
        display: flex;
        width: min(94vw, 560px);
        min-width: 0 !important;
        padding: 22px 16px;
    }

    #mystery-box-modal.mb-result-visible .wheel-modal-content {
        width: min(94vw, 460px);
    }

    #mystery-box-modal.mb-result-visible .mb-result-card {
        max-height: min(560px, calc(100vh - 248px));
    }
}

@media (max-width: 420px) {
    .mb-slot-window {
        width: min(330px, calc(100vw - 46px));
    }

    .mb-result-title {
        font-size: 19px;
    }
}

/* =========================================
   CHAT GLOBAL
   ========================================= */

/* Conteneur principal du chat */
#chat-container {
    max-width: 800px;
    width: 100%;
    height: 400px; /* ~moitié de la map (800px) */
    display: flex;
    flex-direction: column;
    background: #1a1a2e;
    border: 2px solid #444;
    border-top: none;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
}

/* Header du chat */
#chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #16213e;
    border-bottom: 1px solid #333;
    min-height: 36px;
    flex-shrink: 0;
}

#chat-title {
    font-size: 14px;
    font-weight: bold;
    color: #f1c40f;
}

#chat-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

#chat-slow-mode-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #e67e22;
    font-weight: bold;
    background: rgba(230,126,34,0.15);
    padding: 3px 8px;
    border-radius: 10px;
}

#chat-slow-mode-timer {
    color: #e74c3c;
    font-weight: bold;
}

#chat-toggle-btn {
    background: none;
    border: 1px solid #555;
    color: #aaa;
    cursor: pointer;
    font-size: 14px;
    padding: 3px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

#chat-toggle-btn:hover {
    background: #2c3e50;
    color: #ecf0f1;
}

/* Corps du chat */
#chat-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0; /* Important pour le flex shrink */
    overflow: hidden;
}

/* Zone des messages */
#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    scrollbar-width: thin;
    scrollbar-color: #444 #1a1a2e;
}

#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: #1a1a2e;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Message individuel */
.chat-message {
    font-size: 13px;
    line-height: 1.5;
    padding: 2px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: #ecf0f1; /* Messages globaux : blanc */
}

/* Message privé */
.chat-message-private {
    background: rgba(52, 152, 219, 0.1);
    border-left: 3px solid #3498db;
    padding: 3px 8px;
    border-radius: 0 4px 4px 0;
    margin: 2px 0;
}

.chat-message-private .chat-text-private {
    color: #3498db; /* Messages privés : bleu */
}

/* Message ADMIN (modération) */
.chat-message-admin {
    background: rgba(231, 76, 60, 0.12);
    border-left: 3px solid #e74c3c;
    padding: 3px 8px;
    border-radius: 0 4px 4px 0;
    margin: 2px 0;
}

.chat-username-admin {
    color: #e74c3c;
    font-weight: bold;
}

.chat-text-admin {
    color: #e74c3c;
    font-weight: 600;
}

/* Éléments d'un message */
.chat-time {
    color: #555;
    font-size: 11px;
    margin-right: 4px;
}

.chat-username {
    font-weight: bold;
    color: #f1c40f;
}

.chat-username-mine {
    color: #2ecc71;
}

.chat-separator {
    color: #666;
    margin-right: 4px;
}

.chat-text {
    color: #ecf0f1;
}

.chat-text-private {
    color: #3498db;
}

.chat-pm-icon {
    font-size: 11px;
    margin-right: 2px;
}

.chat-pm-arrow {
    color: #3498db;
    margin: 0 3px;
    font-weight: bold;
}

/* Zone d'erreur */
#chat-error {
    font-size: 12px;
    color: #e74c3c;
    text-align: center;
    padding: 4px 8px;
    background: rgba(231, 76, 60, 0.1);
    border-top: 1px solid rgba(231,76,60,0.2);
    flex-shrink: 0;
}

/* Zone de saisie */
#chat-input-area {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: #16213e;
    border-top: 1px solid #333;
    flex-shrink: 0;
}

#chat-input {
    flex: 1;
    padding: 8px 12px;
    background: #0f3460;
    border: 1px solid #444;
    border-radius: 20px;
    color: #ecf0f1;
    font-size: 13px;
    font-family: 'Lato', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

#chat-input:focus {
    border-color: #f1c40f;
}

#chat-input::placeholder {
    color: #555;
    font-size: 12px;
}

#chat-char-counter {
    font-size: 11px;
    color: #666;
    min-width: 24px;
    text-align: center;
    flex-shrink: 0;
}

#chat-send-btn {
    background: #2ecc71;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}

#chat-send-btn:hover {
    background: #27ae60;
}

#chat-send-btn:active {
    transform: scale(0.9);
}

/* Chat réduit */
#chat-container.chat-collapsed #chat-body {
    display: none;
}

#chat-container.chat-collapsed {
    height: auto;
}

#chat-container.chat-collapsed #chat-toggle-btn {
    transform: rotate(180deg);
}

/* =========================================
   CHAT - RESPONSIVE MOBILE
   ========================================= */

/* Tablettes et petits écrans */
@media (max-width: 768px) {
    #chat-container {
        height: 280px;
        border-radius: 0 0 8px 8px;
    }

    .chat-message {
        font-size: 12px;
    }

    #chat-input {
        font-size: 14px; /* Plus grand pour le confort sur mobile */
        padding: 8px 10px;
    }

    #chat-input::placeholder {
        font-size: 11px;
    }

    #chat-send-btn {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    #chat-header {
        padding: 6px 10px;
    }

    #chat-title {
        font-size: 13px;
    }
}

/* Petits mobiles */
@media (max-width: 480px) {
    #chat-container {
        height: 220px;
        border-width: 1px;
    }

    .chat-message {
        font-size: 11px;
        line-height: 1.4;
    }

    .chat-time {
        font-size: 10px;
    }

    #chat-input-area {
        padding: 6px 8px;
        gap: 4px;
    }

    #chat-input {
        padding: 7px 10px;
        font-size: 14px;
        border-radius: 16px;
    }

    #chat-input::placeholder {
        font-size: 10px;
    }

    #chat-char-counter {
        display: none; /* Cacher le compteur sur très petit écran */
    }

    #chat-send-btn {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    #chat-header {
        padding: 5px 8px;
        min-height: 32px;
    }

    #chat-title {
        font-size: 12px;
    }

    #chat-slow-mode-indicator {
        font-size: 10px;
        padding: 2px 6px;
    }
}

/* Mode paysage mobile - chat plus court */
@media (max-height: 500px) and (orientation: landscape) {
    #chat-container {
        height: 150px;
    }

    #chat-header {
        padding: 4px 10px;
        min-height: 28px;
    }

    #chat-input-area {
        padding: 4px 8px;
    }

    #chat-input {
        padding: 5px 10px;
    }

    .chat-message {
        font-size: 11px;
        line-height: 1.3;
        padding: 1px 0;
    }
}

/* =========================================
   TAVERNE (LISTE D'AMIS)
   ========================================= */

/* Ligne d'ami */
.tavern-friend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(0,0,0,0.25);
    border: 1px solid #444;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.tavern-friend-row:hover {
    background: rgba(243,156,18,0.08);
    border-color: #f39c12;
}

.tavern-friend-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.tavern-friend-avatar {
    font-size: 22px;
}

.tavern-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 4px currentColor;
}

.tavern-status-online {
    background-color: #2ecc71;
    box-shadow: 0 0 6px #2ecc71;
}

.tavern-status-offline {
    background-color: #e74c3c;
    box-shadow: 0 0 4px #e74c3c;
}

.tavern-friend-name {
    color: #ecf0f1;
    font-weight: bold;
    font-size: 14px;
}

/* Boutons d'actions amis */
.tavern-friend-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.tavern-btn {
    padding: 6px 10px;
    border: 2px solid #555;
    border-radius: 8px;
    background: #34495e;
    color: #ecf0f1;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tavern-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.tavern-btn-inspect {
    border-color: #3498db;
    color: #3498db;
}
.tavern-btn-inspect:hover {
    background: #3498db;
    color: white;
}

.tavern-btn-talk {
    border-color: #2ecc71;
    color: #2ecc71;
}
.tavern-btn-talk:hover {
    background: #2ecc71;
    color: white;
}

.tavern-btn-duel {
    border-color: #e74c3c;
    color: #e74c3c;
}
.tavern-btn-duel:hover {
    background: #e74c3c;
    color: white;
}

.tavern-btn-coop {
    border-color: #9b59b6;
    color: #9b59b6;
}
.tavern-btn-coop:hover {
    background: #9b59b6;
    color: white;
}

.tavern-btn-remove {
    border-color: #7f8c8d;
    color: #7f8c8d;
    padding: 6px 8px;
}
.tavern-btn-remove:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}

/* Résultats de recherche */
.tavern-search-result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.tavern-search-result-row:last-child {
    border-bottom: none;
}

.tavern-search-username {
    color: #ecf0f1;
    font-size: 13px;
    font-weight: bold;
}

.tavern-add-friend-btn {
    padding: 5px 12px;
    border: 2px solid #2ecc71;
    border-radius: 6px;
    background: transparent;
    color: #2ecc71;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tavern-add-friend-btn:hover {
    background: #2ecc71;
    color: white;
}

/* Demandes en attente */
.tavern-pending-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
}

.tavern-pending-name {
    color: #ecf0f1;
    font-size: 13px;
}

.tavern-pending-actions {
    display: flex;
    gap: 5px;
}

.tavern-btn-accept {
    border-color: #2ecc71;
    color: #2ecc71;
}
.tavern-btn-accept:hover {
    background: #2ecc71;
    color: white;
}

.tavern-btn-reject {
    border-color: #e74c3c;
    color: #e74c3c;
}
.tavern-btn-reject:hover {
    background: #e74c3c;
    color: white;
}

/* Panneau d'inspection */
.tavern-inspect-header {
    position: relative;
    margin-bottom: 10px;
}

.tavern-inspect-close {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    color: #95a5a6;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}
.tavern-inspect-close:hover {
    color: #e74c3c;
}

.tavern-inspect-section {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid rgba(255,255,255,0.05);
}

.tavern-inspect-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tavern-stat-line {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #bdc3c7;
}

.tavern-inspect-spells {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tavern-spell-badge {
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    padding: 3px;
    border: 1px solid #555;
}

.tavern-inspect-team {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tavern-team-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(0,0,0,0.25);
    border-radius: 8px;
    border-left: 3px solid #bdc3c7;
}

.tavern-team-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* Scrollbar personnalisée pour la taverne */
#tavern-friend-list::-webkit-scrollbar,
#tavern-inspect-panel::-webkit-scrollbar,
#tavern-search-results::-webkit-scrollbar {
    width: 6px;
}

#tavern-friend-list::-webkit-scrollbar-track,
#tavern-inspect-panel::-webkit-scrollbar-track,
#tavern-search-results::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 3px;
}

#tavern-friend-list::-webkit-scrollbar-thumb,
#tavern-inspect-panel::-webkit-scrollbar-thumb,
#tavern-search-results::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

#tavern-friend-list::-webkit-scrollbar-thumb:hover,
#tavern-inspect-panel::-webkit-scrollbar-thumb:hover,
#tavern-search-results::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Taverne — popup positionné juste sous le bloc settings */
#tavern-popup-overlay {
    align-items: flex-start !important;
    padding-top: 62px !important;
    box-sizing: border-box !important;
}

#tavern-popup {
    max-height: 100% !important;
}

#tavern-close-btn {
    top: 15px !important;
}

#tavern-title {
    padding-right: 130px;
}

/* Responsive taverne */
@media (max-width: 700px) {
    #tavern-popup {
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 10px !important;
        padding: 15px !important;
        max-height: 100% !important;
    }

    .tavern-friend-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .tavern-friend-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .tavern-btn {
        font-size: 10px;
        padding: 5px 8px;
    }

}

/* Style du bouton Delete (rouge) */
.tavern-btn-remove {
    color: #e74c3c !important;
    background: rgba(231,76,60,0.15) !important;
    border-color: #e74c3c !important;
    font-weight: bold !important;
}

.tavern-btn-remove:hover {
    background: rgba(231,76,60,0.35) !important;
}

/* =========================================
   PVP POPUPS
   ========================================= */

/* Geometrie, safe-area et defilement : voir .fullscreen-layer / .overlay-dialog-host,
   que ces calques portent aussi. Ne rien redeclarer ici : ces regles viennent plus
   loin dans la feuille et gagneraient a specificite egale. */
.pvp-popup-overlay {
    background: rgba(0, 0, 0, 0.75);
    z-index: 100100;
    display: flex;
}

.pvp-popup {
    background: linear-gradient(135deg, #1e272e 0%, #2c3e50 100%);
    border: 3px solid #f39c12;
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    color: #ecf0f1;
    box-shadow: 0 15px 50px rgba(243, 156, 18, 0.3);
}

.pvp-popup-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.pvp-popup-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    margin: 5px;
    font-size: 14px;
    transition: opacity 0.2s;
}

.pvp-popup-btn:hover {
    opacity: 0.85;
}

.pvp-btn-accept {
    background: #2ecc71;
    color: #fff;
}

.pvp-btn-decline {
    background: #e74c3c;
    color: #fff;
}

.pvp-btn-cancel {
    background: #7f8c8d;
    color: #fff;
}

.pvp-btn-return {
    background: #3498db;
    color: #fff;
}

.pvp-result-overlay .pvp-result-popup {
    position: relative;
    overflow: hidden;
    max-width: 460px;
    padding: 28px 28px 26px;
    border-width: 3px;
    animation: pvpResultPopupIn 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.pvp-result-popup.is-victory {
    border-color: #f1c40f;
    background:
        radial-gradient(circle at 50% 0%, rgba(241, 196, 15, 0.28), transparent 58%),
        linear-gradient(160deg, #1a1408 0%, #2c2410 42%, #12100c 100%);
    box-shadow:
        0 0 40px rgba(241, 196, 15, 0.35),
        0 18px 50px rgba(0, 0, 0, 0.55);
}

.pvp-result-popup.is-defeat {
    border-color: #c0392b;
    background:
        radial-gradient(circle at 50% 0%, rgba(192, 57, 43, 0.32), transparent 58%),
        linear-gradient(160deg, #1a0b0b 0%, #2a1214 42%, #10090a 100%);
    box-shadow:
        0 0 40px rgba(192, 57, 43, 0.32),
        0 18px 50px rgba(0, 0, 0, 0.55);
}

.pvp-result-versus {
    margin: 0 0 10px;
    color: rgba(255, 255, 255, 0.92);
    font: 800 clamp(15px, 3.6vw, 22px)/1.25 "Trebuchet MS", Arial, sans-serif;
    letter-spacing: 0.04em;
    text-transform: none;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.65);
}

.pvp-result-popup.is-victory .pvp-result-versus {
    color: #f8e7a0;
}

.pvp-result-popup.is-defeat .pvp-result-versus {
    color: #f5c6c0;
}

.pvp-result-popup .pvp-popup-icon {
    font-size: 58px;
    margin: 4px 0 8px;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.45));
}

.pvp-result-outcome {
    color: #ecf0f1;
    font: 900 clamp(22px, 5vw, 32px)/1.15 "Trebuchet MS", Arial, sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.pvp-result-popup.is-victory .pvp-result-outcome {
    color: #f1c40f;
    text-shadow: 0 0 18px rgba(241, 196, 15, 0.45);
}

.pvp-result-popup.is-defeat .pvp-result-outcome {
    color: #ff6b5b;
    text-shadow: 0 0 18px rgba(231, 76, 60, 0.4);
}

.pvp-result-gold {
    margin: 6px 0 2px;
    font: 900 clamp(34px, 8vw, 54px)/1 Impact, "Arial Black", Arial, sans-serif;
    letter-spacing: 0.02em;
    text-shadow: 0 3px 0 rgba(0, 0, 0, 0.55);
}

.pvp-result-popup.is-victory .pvp-result-gold {
    color: #f1c40f;
    text-shadow:
        0 0 22px rgba(241, 196, 15, 0.55),
        0 4px 0 #7a5b08;
}

.pvp-result-popup.is-defeat .pvp-result-gold {
    color: #ff5a4a;
    text-shadow:
        0 0 22px rgba(231, 76, 60, 0.5),
        0 4px 0 #6d1610;
}

.pvp-result-gold-label {
    margin: 0 0 18px;
    color: rgba(236, 240, 241, 0.78);
    font: 800 13px/1 Arial, sans-serif;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.pvp-result-popup .pvp-btn-return {
    min-width: 70%;
    padding: 12px 22px;
    font-size: 15px;
}

@keyframes pvpResultPopupIn {
    from { opacity: 0; transform: scale(0.86) translateY(18px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.pvp-challenge-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.pvp-progress-bar {
    width: 100%;
    height: 6px;
    background: #34495e;
    border-radius: 3px;
    margin: 15px 0;
    overflow: hidden;
}

.pvp-progress-bar > div {
    height: 100%;
    background: #f39c12;
    border-radius: 3px;
    transition: width 0.5s linear;
}

/* =========================================
   CO-OP DUNGEONS
   ========================================= */

.coop-popup {
    border-color: #2ecc71 !important;
    box-shadow: 0 15px 50px rgba(46, 204, 113, 0.3) !important;
}

.coop-popup .pvp-progress-bar > div {
    background: #2ecc71;
}

.coop-dungeon-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.coop-dungeon-row:hover {
    background: rgba(46, 204, 113, 0.25);
    border-color: #2ecc71;
}

.coop-dungeon-row .dungeon-name {
    font-weight: bold;
    color: #ecf0f1;
    font-size: 14px;
}

.coop-dungeon-row .dungeon-keys {
    font-size: 12px;
    color: #bdc3c7;
}

.timeline-coop-partner {
    border: 2px solid #3498db !important;
}

.timeline-entity.active.timeline-coop-partner {
    border-color: #f1c40f !important;
}

/* =========================================
   JEWELRY POPUP - positionné juste sous le bloc settings
   ========================================= */

#jewelry-popup-overlay {
    align-items: flex-start !important;
    padding-top: 62px !important;
    box-sizing: border-box !important;
}

#jewelry-popup {
    max-height: 100% !important;
}

#jewelry-close-btn {
    top: 15px !important;
}

#jewelry-popup-title {
    padding-right: 130px;
}

/* =============================================
   COLISEUM
   ============================================= */

.coliseum-screen {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border: 3px solid #f1c40f;
    border-radius: 20px;
    padding: 20px;
    max-width: 700px;
    width: 95%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(241, 196, 15, 0.3), 0 15px 50px rgba(0,0,0,0.6);
}

.coliseum-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.coliseum-title {
    color: #f1c40f;
    margin: 0;
    font-size: 1.5em;
    text-shadow: 0 0 15px rgba(241, 196, 15, 0.5);
}

/* Conteneurs des popups avec bouton CLOSE en haut à droite */
#tavern-popup,
#jewelry-popup {
    position: relative;
}

.coliseum-close-btn {
    background: #e74c3c;
    border: 3px solid #c0392b;
    border-radius: 8px;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    padding: 12px 24px;
    transition: all 0.2s ease;
    font-family: 'Lato', sans-serif;
    letter-spacing: 2px;
    min-width: 100px;
    text-align: center;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.5), 0 2px 4px rgba(0, 0, 0, 0.6);
}
.coliseum-close-btn:hover {
    background: #c0392b;
    border-color: #a93226;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.7), 0 4px 8px rgba(0, 0, 0, 0.7);
}
.coliseum-close-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.5), 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* Tabs */
.coliseum-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.coliseum-tab {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #555;
    border-radius: 10px;
    background: #2c3e50;
    color: #bdc3c7;
    font-size: 0.95em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}
.coliseum-tab:hover {
    background: #34495e;
    border-color: #f1c40f;
    color: #f1c40f;
}
.coliseum-tab.active {
    background: linear-gradient(135deg, #f39c12, #f1c40f);
    color: #1a1a2e;
    border-color: #f1c40f;
}

/* Section container */
.coliseum-section {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #f1c40f #1a1a2e;
}

/* Doors container */
.coliseum-doors-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Individual door card */
.coliseum-door {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border: 2px solid #555;
    border-radius: 12px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
}
.coliseum-door:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

/* Door tiers */
.coliseum-door[data-tier="bronze"] { border-color: #cd7f32; }
.coliseum-door[data-tier="silver"] { border-color: #c0c0c0; }
.coliseum-door[data-tier="gold"]   { border-color: #ffd700; }
.coliseum-door[data-tier="platinum"] { border-color: #e5e4e2; box-shadow: 0 0 10px rgba(229,228,226,0.3); }
.coliseum-door[data-tier="diamond"] { border-color: #b9f2ff; box-shadow: 0 0 15px rgba(185,242,255,0.4); }

.coliseum-door[data-tier="bronze"] .coliseum-door-tier { color: #cd7f32; }
.coliseum-door[data-tier="silver"] .coliseum-door-tier { color: #c0c0c0; }
.coliseum-door[data-tier="gold"] .coliseum-door-tier   { color: #ffd700; }
.coliseum-door[data-tier="platinum"] .coliseum-door-tier { color: #e5e4e2; }
.coliseum-door[data-tier="diamond"] .coliseum-door-tier { color: #b9f2ff; }

.coliseum-door-header {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 130px;
}
.coliseum-door-icon {
    font-size: 1.4em;
}
.coliseum-door-tier {
    font-weight: bold;
    font-size: 0.9em;
}

.coliseum-door-bet {
    color: #f1c40f;
    font-weight: bold;
    font-size: 0.95em;
    min-width: 120px;
    text-align: center;
}

.coliseum-door-status {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 100px;
}

.coliseum-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.coliseum-status-dot.free {
    background: #2ecc71;
    box-shadow: 0 0 6px #2ecc71;
}
.coliseum-status-dot.occupied {
    background: #e74c3c;
    box-shadow: 0 0 6px #e74c3c;
    animation: coliseum-pulse 1.5s ease-in-out infinite;
}

.coliseum-status-text {
    color: #ecf0f1;
    font-size: 0.85em;
}

@keyframes coliseum-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.3); }
}

.coliseum-door-btn {
    margin-left: auto;
    padding: 8px 14px;
    border: 2px solid #3498db;
    border-radius: 8px;
    background: linear-gradient(135deg, #2980b9, #3498db);
    color: #fff;
    font-weight: bold;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}
.coliseum-door-btn:hover {
    background: linear-gradient(135deg, #3498db, #5dade2);
    transform: scale(1.05);
}
.coliseum-door-btn.fight {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-color: #e74c3c;
    animation: coliseum-fight-glow 1.5s ease-in-out infinite;
}
.coliseum-door-btn.fight:hover {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
}

@keyframes coliseum-fight-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(231, 76, 60, 0.3); }
    50% { box-shadow: 0 0 20px rgba(231, 76, 60, 0.7); }
}

/* Waiting zone */
.coliseum-waiting-zone {
    text-align: center;
    padding: 30px 20px;
    margin-top: 15px;
    background: linear-gradient(135deg, #1e272e 0%, #2c3e50 100%);
    border: 2px solid #f39c12;
    border-radius: 15px;
    animation: coliseum-waiting-border 3s linear infinite;
}

@keyframes coliseum-waiting-border {
    0%   { border-color: #f39c12; }
    33%  { border-color: #f1c40f; }
    66%  { border-color: #e67e22; }
    100% { border-color: #f39c12; }
}

.coliseum-waiting-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #555;
    border-top: 4px solid #f1c40f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.coliseum-waiting-text {
    color: #f1c40f;
    font-size: 1.1em;
    font-weight: bold;
    margin: 0 0 8px;
}

.coliseum-waiting-bet {
    color: #ecf0f1;
    font-size: 0.95em;
    margin: 0 0 15px;
}

.coliseum-leave-btn {
    padding: 10px 25px;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: #fff;
    font-weight: bold;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s;
}
.coliseum-leave-btn:hover {
    background: linear-gradient(135deg, #e74c3c, #ff6b6b);
    transform: scale(1.05);
}

/* Rankings */
.coliseum-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.coliseum-search-bar input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #555;
    border-radius: 10px;
    background: #2c3e50;
    color: #ecf0f1;
    font-size: 0.95em;
    outline: none;
    transition: border-color 0.3s;
}
.coliseum-search-bar input:focus {
    border-color: #f1c40f;
}
.coliseum-search-bar input::placeholder {
    color: #7f8c8d;
}

.coliseum-search-btn {
    padding: 10px 15px;
    border: 2px solid #f1c40f;
    border-radius: 10px;
    background: #2c3e50;
    color: #f1c40f;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s;
}
.coliseum-search-btn:hover {
    background: #f1c40f;
    color: #1a1a2e;
}

.coliseum-ranking-table-wrapper {
    overflow-x: auto;
}

.coliseum-ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.coliseum-ranking-table thead th {
    background: #2c3e50;
    color: #f1c40f;
    padding: 10px 8px;
    text-align: left;
    border-bottom: 2px solid #f1c40f;
    position: sticky;
    top: 0;
    z-index: 1;
}

.coliseum-ranking-table tbody tr {
    border-bottom: 1px solid #34495e;
    transition: background 0.2s;
}
.coliseum-ranking-table tbody tr:hover {
    background: rgba(241, 196, 15, 0.1);
}

.coliseum-ranking-table td {
    padding: 10px 8px;
    color: #ecf0f1;
}

/* Top 3 highlight */
.coliseum-ranking-table tbody tr.rank-1 td:first-child { color: #ffd700; font-weight: bold; font-size: 1.1em; }
.coliseum-ranking-table tbody tr.rank-2 td:first-child { color: #c0c0c0; font-weight: bold; }
.coliseum-ranking-table tbody tr.rank-3 td:first-child { color: #cd7f32; font-weight: bold; }

.coliseum-ranking-table tbody tr.rank-1 { background: rgba(255, 215, 0, 0.08); }
.coliseum-ranking-table tbody tr.rank-2 { background: rgba(192, 192, 192, 0.06); }
.coliseum-ranking-table tbody tr.rank-3 { background: rgba(205, 127, 50, 0.06); }

/* Pagination */
.coliseum-ranking-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #34495e;
}

.coliseum-page-btn {
    padding: 6px 14px;
    border: 2px solid #555;
    border-radius: 8px;
    background: #2c3e50;
    color: #ecf0f1;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}
.coliseum-page-btn:hover:not(:disabled) {
    border-color: #f1c40f;
    color: #f1c40f;
}
.coliseum-page-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

#coliseum-rank-page {
    color: #f1c40f;
    font-weight: bold;
    font-size: 1em;
}

/* Mobile responsive */
@media (max-width: 600px) {
    #coliseum-popup-overlay {
        padding-top: 115px !important;
    }

    .coliseum-screen {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        /* border-box : sans lui, un plafond en % ne compte que la boite de
           CONTENU et le dialogue depasse de son propre padding + bordure. */
        box-sizing: border-box;
        max-height: 100%;
        height: 100%;
        padding: 12px;
    }

    .coliseum-door {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
    }

    .coliseum-door-header {
        min-width: unset;
        flex: 1;
    }

    .coliseum-door-bet {
        min-width: unset;
        font-size: 0.85em;
    }

    .coliseum-door-status {
        min-width: unset;
    }

    .coliseum-door-btn {
        width: 100%;
        margin-left: 0;
        text-align: center;
        padding: 10px;
    }

    .coliseum-tabs {
        gap: 5px;
    }
    .coliseum-tab {
        padding: 8px 10px;
        font-size: 0.85em;
    }
}

/* =============================================
   MARKETPLACE NFT
   ============================================= */

.marketplace-screen {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1200px;
  height: 100vh;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2e 100%);
  color: #e0d0ff;
  font-family: inherit;
  overflow: hidden;
  position: relative;
  padding-top: 115px; /* Espace pour settings-wrapper (60px) + close-btn (55px) */
  box-sizing: border-box;
}


/* Header */
.marketplace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.mp-title {
  font-size: 40px;
  font-weight: bold;
  margin: 0;
  color: #c8a8ff;
}

.mp-balance-display {
  font-size: 14px;
  color: #a0e0ff;
  font-weight: bold;
}

/* Onglets principaux */
.mp-main-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  background: rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.mp-main-tab {
  padding: 8px 20px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px 8px 0 0;
  background: rgba(255,255,255,0.05);
  color: #a080cc;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}
.mp-main-tab.active, .mp-main-tab:hover {
  background: rgba(180,100,255,0.2);
  color: #e0c0ff;
  border-color: rgba(180,100,255,0.4);
}

/* Contenu onglets */
.mp-tab-content {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.mp-tab-content.active { display: flex; }

/* Sous-onglets */
.mp-subtabs {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  flex-shrink: 0;
}

.mp-subtab {
  padding: 6px 16px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  background: transparent;
  color: #a080cc;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.mp-subtab.active, .mp-subtab:hover {
  background: rgba(180,100,255,0.25);
  color: #e0c0ff;
  border-color: rgba(180,100,255,0.5);
}

/* Filtres */
.mp-filters {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  flex-shrink: 0;
}

.mp-filters input[type="text"] {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  background: rgba(255,255,255,0.07);
  color: #e0d0ff;
  font-size: 13px;
}
.mp-filters input[type="text"]::placeholder { color: #6050a0; }

.mp-sort-select {
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  background: rgba(20,10,40,0.9);
  color: #e0d0ff;
  font-size: 13px;
  cursor: pointer;
}

/* Grille de listings */
.mp-listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  align-content: start; /* évite l'étirement vertical des cartes quand l'espace est large */
  gap: 12px;
  padding: 12px 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0; /* Permet le scroll correct dans un conteneur flex */
}

/* Cards NFT */
.mp-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.mp-card:hover {
  background: rgba(180,100,255,0.12);
  border-color: rgba(180,100,255,0.4);
  transform: translateY(-2px);
}

.mp-card-icon { font-size: 32px; text-align: center; }
.mp-card-img { width: 64px; height: 64px; object-fit: contain; margin: 0 auto; display: block; }
.mp-card-name { font-size: 13px; font-weight: bold; color: #e0d0ff; text-align: center; }

/* Badges de rareté */
.mp-card-rarity {
  font-size: 11px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: bold;
}
.rarity-Common, .rarity-Aucun  { background: rgba(150,150,150,0.25); color: #c0c0c0; }
.rarity-Rare,   .rarity-Commun { background: rgba(80,120,255,0.25); color: #80a8ff; }
.rarity-Legendary, .rarity-Légendaire { background: rgba(255,160,0,0.25); color: #ffcc60; }
.rarity-Rare-passive { background: rgba(180,80,255,0.25); color: #d080ff; }

.mp-card-spell  { font-size: 11px; color: #a0d0ff; text-align: center; }
.mp-card-stats  { font-size: 11px; color: #c0b0e0; text-align: center; }
.mp-card-level  { font-size: 11px; color: #c0b0e0; text-align: center; }
.mp-card-price  {
  font-size: 13px;
  font-weight: bold;
  color: #60e0ff;
  text-align: center;
  margin-top: auto;
}
.mp-card-seller { font-size: 10px; color: #6050a0; text-align: center; }
.mp-dofecoin-icon { width: 16px; height: 16px; vertical-align: middle; margin-right: 2px; object-fit: contain; }

/* Badge "Équipé" sur les items non vendables */
.mp-card-equipped-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(255,100,100,0.8);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: bold;
}
.mp-card.equipped {
  opacity: 0.5;
  cursor: not-allowed;
}
.mp-card.equipped:hover { transform: none; }

/* Avertissement royalties */
.mp-royalty-warning {
  margin: 8px 16px;
  padding: 10px 14px;
  background: rgba(255,200,0,0.1);
  border: 1px solid rgba(255,200,0,0.3);
  border-radius: 8px;
  font-size: 12px;
  color: #ffe080;
  flex-shrink: 0;
}

/* Modals */
.mp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.mp-modal {
  background: linear-gradient(135deg, #1a1030, #2a1550);
  border: 1px solid rgba(180,100,255,0.4);
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mp-modal h3 { margin: 0; color: #c8a8ff; font-size: 18px; text-align: center; }

.mp-modal-preview {
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.mp-price-input-group { display: flex; flex-direction: column; gap: 6px; }
.mp-price-input-group label { font-size: 13px; color: #a080cc; }
.mp-price-input-group input {
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  background: rgba(255,255,255,0.07);
  color: #e0d0ff;
  font-size: 16px;
}

.mp-net-display { font-size: 14px; color: #80e080; margin: 0; text-align: center; }
.mp-buy-price-display { font-size: 16px; color: #60e0ff; margin: 0; text-align: center; }
.mp-modal-info { font-size: 11px; color: #8070a0; margin: 0; text-align: center; }

.mp-modal-buttons { display: flex; gap: 10px; }
.mp-btn-confirm {
  flex: 1;
  padding: 12px;
  background: linear-gradient(135deg, #6020c0, #9040ff);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s;
}
.mp-btn-confirm:hover { opacity: 0.85; }
.mp-btn-confirm:disabled { opacity: 0.4; cursor: not-allowed; }

.mp-btn-cancel {
  flex: 1;
  padding: 12px;
  background: rgba(255,80,80,0.15);
  border: 1px solid rgba(255,80,80,0.3);
  border-radius: 10px;
  color: #ff8080;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.mp-btn-cancel:hover { background: rgba(255,80,80,0.25); }

/* Modal chargement */
.mp-loading-modal { align-items: center; justify-content: center; }
.mp-spinner {
  width: 40px; height: 40px;
  border: 4px solid rgba(180,100,255,0.3);
  border-top-color: #a060ff;
  border-radius: 50%;
  animation: mp-spin 0.8s linear infinite;
}
@keyframes mp-spin { to { transform: rotate(360deg); } }
.mp-loading-progress { width: 100%; margin-top: 14px; }
.mp-progress-bar {
  width: 100%; height: 5px;
  background: rgba(160,96,255,0.15);
  border-radius: 3px; overflow: hidden;
}
.mp-progress-fill {
  height: 100%; background: #a060ff;
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}
.mp-progress-label {
  display: block; text-align: center;
  font-size: 11px; color: #8060c0;
  margin-top: 6px; letter-spacing: 0.05em;
}

/* Countdown timer post-mint */
.mp-mint-countdown {
  display: flex; flex-direction: column; align-items: center;
  margin-top: 16px; gap: 10px;
}
.mp-mint-countdown-ring {
  position: relative; width: 64px; height: 64px;
}
.mp-countdown-svg {
  width: 64px; height: 64px;
  transform: rotate(-90deg);
}
.mp-countdown-bg {
  fill: none; stroke: rgba(160,96,255,0.15);
  stroke-width: 3;
}
.mp-countdown-arc {
  fill: none; stroke: #a060ff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}
.mp-countdown-number {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px; font-weight: 700; color: #c080ff;
  line-height: 1;
}
.mp-countdown-text {
  font-size: 12px; color: #b090e0; text-align: center;
  max-width: 220px; line-height: 1.5;
}

/* État vide / chargement */
.mp-loading, .mp-empty {
  grid-column: 1/-1;
  text-align: center;
  color: #6050a0;
  padding: 40px;
  font-size: 14px;
}

/* ============ HISTORIQUE ============ */
.mp-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.mp-history-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 10px 14px;
}
.mp-history-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mp-history-icon img { width: 44px; height: 44px; object-fit: contain; }
.mp-history-info { flex: 1; min-width: 0; }
.mp-history-name {
  font-size: 13px;
  font-weight: bold;
  color: #e0d0ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mp-history-counterparty { font-size: 11px; color: #a080cc; margin-top: 2px; }
.mp-history-counterparty .mp-addr { color: #c0b0e0; font-family: monospace; }
.mp-history-date { font-size: 10px; color: #6050a0; margin-top: 2px; }
.mp-history-amount {
  font-size: 14px;
  font-weight: bold;
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
}
.mp-history-amount.mp-amount-out { color: #ff8080; }
.mp-history-amount.mp-amount-in  { color: #60e0a0; }
.mp-history-amount .mp-dofecoin-icon { margin-right: 0; margin-left: 2px; }

/* Mes annonces — bouton annuler */
.mp-cancel-listing-btn {
  width: 100%;
  margin-top: 6px;
  padding: 6px;
  background: rgba(255,80,80,0.15);
  border: 1px solid rgba(255,80,80,0.3);
  border-radius: 8px;
  color: #ff8080;
  font-size: 12px;
  cursor: pointer;
}
.mp-cancel-listing-btn:hover { background: rgba(255,80,80,0.3); }

/* Subtab content */
.mp-subtab-content { display: none; }
.mp-subtab-content.active { display: grid; } /* display:grid préserve la mise en page en grille (colonnes) */

/* ---- Panneau stats Dofemon (VENTE + ACHAT) ---- */

/* Quand le panneau stats est visible, limiter la grille vente pour qu'on voie le panneau */
#mp-sell-dofemon.mp-grid-compact {
  flex: 0 0 auto;
  max-height: 260px;
}

.mp-dofemon-stats-panel {
  background: linear-gradient(135deg, rgba(30,15,60,0.95), rgba(50,20,90,0.95));
  border: 1px solid rgba(180,100,255,0.45);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: mp-stats-fadein 0.18s ease;
  margin: 6px 16px 12px;
  flex-shrink: 0;
  max-height: 60vh;
  overflow-y: auto;
}
@keyframes mp-stats-fadein {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mp-stats-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mp-stats-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
}
.mp-stats-icon-big {
  font-size: 44px;
  line-height: 1;
}
.mp-stats-title-block {
  flex: 1;
}
.mp-stats-name {
  font-size: 16px;
  font-weight: bold;
  color: #e0d0ff;
}
.mp-stats-meta {
  font-size: 12px;
  color: #a080cc;
  margin-top: 2px;
}
.mp-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 6px;
}
.mp-stat-box {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(180,100,255,0.2);
  border-radius: 8px;
  padding: 6px 8px;
  text-align: center;
}
.mp-stat-box .mp-stat-label {
  font-size: 10px;
  color: #8070a0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.mp-stat-box .mp-stat-value {
  font-size: 15px;
  font-weight: bold;
  color: #c8a8ff;
  margin-top: 2px;
}
.mp-stats-spells {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(160,80,255,0.2);
  border-radius: 8px;
  padding: 8px 10px;
}
.mp-stats-spells-title {
  font-size: 11px;
  color: #8070a0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.mp-stats-spells-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.mp-spell-chip {
  background: rgba(100,40,200,0.3);
  border: 1px solid rgba(160,80,255,0.3);
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 11px;
  color: #c0a0ff;
  white-space: nowrap;
}
.mp-stats-passive {
  font-size: 12px;
  color: #c0b0e0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(160,80,255,0.2);
  border-radius: 8px;
  padding: 6px 10px;
}
.mp-stats-passive strong { color: #e0c0ff; }
.mp-passive-desc { font-size: 11px; color: #a0d0ff; font-style: italic; margin-top: 2px; display: block; }

/* Chips de sorts cliquables */
.mp-spell-clickable {
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.mp-spell-clickable:hover {
  background: rgba(140,60,255,0.5);
  border-color: rgba(200,120,255,0.7);
}

/* Popup détail d'un sort */
.mp-spell-popup {
  position: fixed;
  z-index: 10001;
  width: 240px;
  background: #1a1030;
  border: 1px solid rgba(160,80,255,0.5);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7), 0 0 0 1px rgba(100,40,200,0.3);
  color: #e0d0ff;
  font-size: 12px;
}
.mp-spell-popup-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}
.mp-spell-popup-icon { font-size: 20px; }
.mp-spell-popup-name {
  font-weight: bold;
  font-size: 14px;
  color: #c8a8ff;
  flex: 1;
}
.mp-spell-popup-close {
  cursor: pointer;
  color: #6050a0;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s;
}
.mp-spell-popup-close:hover { color: #e0c0ff; }
.mp-spell-popup-type {
  font-size: 11px;
  color: #a080cc;
  margin-bottom: 8px;
  text-transform: capitalize;
}
.mp-spell-popup-stats {
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 6px 8px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mp-spell-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #c0b0e0;
}
.mp-spell-stat-row span:last-child {
  font-weight: bold;
  color: #e0d0ff;
}
.mp-spell-popup-desc {
  font-size: 11px;
  color: #9080b0;
  font-style: italic;
  line-height: 1.5;
}
@media (max-width: 599px) {
  .mp-spell-popup {
    width: calc(100vw - 24px);
    max-width: 320px;
    max-height: 80vh;
    overflow-y: auto;
  }
}

.mp-stats-sell-btn {
  padding: 11px;
  background: linear-gradient(135deg, #6020c0, #9040ff);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-top: 2px;
}
.mp-stats-sell-btn:hover { opacity: 0.85; }
.mp-stats-close-btn {
  padding: 8px;
  background: rgba(255,80,80,0.12);
  border: 1px solid rgba(255,80,80,0.25);
  border-radius: 8px;
  color: #ff8080;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.mp-stats-close-btn:hover { background: rgba(255,80,80,0.25); }

/* Stats panel inside buy modal — scrollable preview */
.mp-modal-preview.mp-preview-tall {
  max-height: 55vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #6030a0 transparent;
}
.mp-modal-preview.mp-preview-tall::-webkit-scrollbar { width: 4px; }
.mp-modal-preview.mp-preview-tall::-webkit-scrollbar-thumb { background: #6030a0; border-radius: 4px; }
.mp-buy-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  margin-top: 8px;
}
.mp-buy-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  padding: 4px 8px;
}
.mp-buy-stat-row .mp-stat-lbl { font-size: 11px; color: #8070a0; }
.mp-buy-stat-row .mp-stat-val { font-size: 13px; font-weight: bold; color: #c8a8ff; }
.mp-buy-spells-section {
  margin-top: 8px;
  text-align: left;
}
.mp-buy-spells-label {
  font-size: 10px;
  color: #8070a0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.mp-buy-spells-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}
.mp-card.mp-card-selected {
  border: 2px solid #9040ff;
  box-shadow: 0 0 12px rgba(144,64,255,0.5);
  transform: translateY(-3px);
}

/* =============================================
   MARKETPLACE — Responsive mobile
   ============================================= */

@media (max-width: 768px) {
  .marketplace-screen { padding-top: 110px; }

  .marketplace-header {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
  }

  .mp-title {
    font-size: 28px;
    order: -1;
    flex: 1 0 100%;
    text-align: center;
  }

  .mp-balance-display { font-size: 12px; margin-left: auto; }

  .mp-main-tabs { padding: 6px 8px; gap: 4px; }
  .mp-main-tab  { padding: 7px 10px; font-size: 12px; flex: 1; text-align: center; }
  .mp-subtabs   { padding: 6px 8px; gap: 6px; }
  .mp-subtab    { font-size: 12px; padding: 5px 10px; flex: 1; text-align: center; }

  /* Filtres ACHETER : search + sort sur la même ligne */
  .mp-filters { flex-direction: row; flex-wrap: wrap; padding: 6px 8px; gap: 6px; }
  .mp-filters input[type="text"] { flex: 1 1 60%; min-width: 0; box-sizing: border-box; }
  .mp-sort-select { flex: 1 1 35%; min-width: 0; box-sizing: border-box; }

  /* Grille ACHAT et MES ANNONCES : même comportement que VENTE */
  .mp-listing-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    padding: 8px;
  }

  /* MES ANNONCES : le grid doit prendre toute la hauteur disponible */
  #mp-my-listings-grid {
    align-content: start; /* évite que les cartes s'étirent verticalement */
  }

  .mp-card        { padding: 8px; gap: 4px; }
  .mp-card-icon   { font-size: 26px; }
  .mp-card-img    { width: 52px; height: 52px; }
  .mp-card-name   { font-size: 12px; }
  .mp-card-spell, .mp-card-stats, .mp-card-level { font-size: 10px; }
  .mp-card-price  { font-size: 12px; }
  .mp-card-seller { font-size: 9px; }

  .mp-modal { width: 95%; padding: 16px; gap: 10px; }
  .mp-modal h3 { font-size: 15px; }
  .mp-btn-confirm, .mp-btn-cancel { font-size: 13px; padding: 10px; }
}

@media (max-width: 480px) {
  .marketplace-screen  { padding-top: 105px; }
  .marketplace-header  { padding: 6px 8px; }
  .mp-title            { font-size: 24px; }
  .mp-balance-display  { font-size: 11px; }
  .mp-main-tab         { padding: 6px; font-size: 11px; }

  /* Filtres ACHETER sur petits écrans : empilés verticalement */
  .mp-filters { flex-direction: column; }
  .mp-filters input[type="text"] { flex: none; width: 100%; }
  .mp-sort-select { flex: none; width: 100%; }

  .mp-listing-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 6px;
  }

  /* MES ANNONCES : 2 colonnes identiques à VENTE/ACHAT */
  #mp-my-listings-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .mp-card      { padding: 6px; }
  .mp-card-icon { font-size: 22px; }
  .mp-card-img  { width: 44px; height: 44px; }
  .mp-card-name { font-size: 11px; }
  .mp-card-price { font-size: 11px; }

  .mp-royalty-warning { margin: 4px 8px; padding: 8px 10px; font-size: 11px; }
}

/* =============================================
   MARKETPLACE SUCCESS POPUP
   ============================================= */

.mp-success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: mpSuccessFadeIn 0.25s ease-out;
}

@keyframes mpSuccessFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.mp-success-popup {
    position: relative;
    background: linear-gradient(160deg, #120d28, #1e1040);
    border-radius: 20px;
    padding: 36px 32px 28px;
    width: 90%;
    max-width: 360px;
    text-align: center;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    animation: mpSuccessPopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes mpSuccessPopIn {
    from { opacity: 0; transform: scale(0.7) translateY(30px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Variante VENTE — bordure dorée */
.mp-success-popup--sell {
    border: 2px solid rgba(255, 200, 60, 0.6);
    box-shadow: 0 0 40px rgba(255, 180, 0, 0.25), 0 8px 32px rgba(0,0,0,0.7);
}

/* Variante ACHAT — bordure émeraude */
.mp-success-popup--buy {
    border: 2px solid rgba(60, 220, 130, 0.6);
    box-shadow: 0 0 40px rgba(40, 200, 100, 0.25), 0 8px 32px rgba(0,0,0,0.7);
}

/* Anneau animé avec checkmark */
.mp-success-ring {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    animation: mpSuccessRingPop 0.5s 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.mp-success-popup--sell .mp-success-ring {
    background: radial-gradient(circle, rgba(255,180,0,0.3), rgba(255,140,0,0.1));
    border: 3px solid rgba(255, 200, 60, 0.8);
    box-shadow: 0 0 20px rgba(255, 180, 0, 0.4);
}

.mp-success-popup--buy .mp-success-ring {
    background: radial-gradient(circle, rgba(40,200,100,0.3), rgba(20,160,80,0.1));
    border: 3px solid rgba(60, 220, 130, 0.8);
    box-shadow: 0 0 20px rgba(40, 200, 100, 0.4);
}

@keyframes mpSuccessRingPop {
    from { opacity: 0; transform: scale(0.4); }
    to   { opacity: 1; transform: scale(1); }
}

.mp-success-check {
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
}

.mp-success-popup--sell .mp-success-check { color: #ffc83c; }
.mp-success-popup--buy  .mp-success-check { color: #3cdc82; }

/* Grande icône de l'item */
.mp-success-item-icon {
    font-size: 48px;
    line-height: 1;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
    animation: mpSuccessIconBounce 0.5s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes mpSuccessIconBounce {
    from { opacity: 0; transform: scale(0.5) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.mp-success-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.5px;
    animation: mpSuccessFadeUp 0.4s 0.35s ease-out both;
}

.mp-success-popup--sell .mp-success-title { color: #ffd060; }
.mp-success-popup--buy  .mp-success-title { color: #5aedaa; }

.mp-success-item-name {
    font-size: 15px;
    color: #e0d0ff;
    font-weight: 600;
    animation: mpSuccessFadeUp 0.4s 0.42s ease-out both;
}

.mp-success-detail {
    font-size: 13px;
    color: #a08cc0;
    animation: mpSuccessFadeUp 0.4s 0.48s ease-out both;
}

@keyframes mpSuccessFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mp-success-close-btn {
    margin-top: 8px;
    padding: 10px 40px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, filter 0.15s;
    animation: mpSuccessFadeUp 0.4s 0.55s ease-out both;
}

.mp-success-popup--sell .mp-success-close-btn {
    background: linear-gradient(135deg, #c87800, #ffb820);
    color: #1a0d00;
    box-shadow: 0 4px 16px rgba(255, 160, 0, 0.4);
}

.mp-success-popup--buy .mp-success-close-btn {
    background: linear-gradient(135deg, #158a50, #3cdc82);
    color: #001a0d;
    box-shadow: 0 4px 16px rgba(40, 200, 100, 0.4);
}

.mp-success-close-btn:hover {
    transform: translateY(-2px) scale(1.04);
    filter: brightness(1.15);
}

/* Particules flottantes */
.mp-success-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.mp-success-particle {
    position: absolute;
    bottom: -10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    opacity: 0;
    animation: mpParticleFloat 2.5s ease-in-out infinite;
}

.mp-success-popup--sell .mp-success-particle { background: rgba(255, 200, 60, 0.7); }
.mp-success-popup--buy  .mp-success-particle { background: rgba(60, 220, 130, 0.7); }

.mp-success-particle--1  { left: 8%;  animation-delay: 0.1s;  width: 5px;  height: 5px; }
.mp-success-particle--2  { left: 18%; animation-delay: 0.5s;  width: 7px;  height: 7px; }
.mp-success-particle--3  { left: 30%; animation-delay: 0.2s;  width: 4px;  height: 4px; }
.mp-success-particle--4  { left: 42%; animation-delay: 0.8s;  width: 6px;  height: 6px; }
.mp-success-particle--5  { left: 55%; animation-delay: 0.3s;  width: 5px;  height: 5px; }
.mp-success-particle--6  { left: 65%; animation-delay: 0.6s;  width: 8px;  height: 8px; }
.mp-success-particle--7  { left: 75%; animation-delay: 0.1s;  width: 4px;  height: 4px; }
.mp-success-particle--8  { left: 85%; animation-delay: 0.9s;  width: 6px;  height: 6px; }
.mp-success-particle--9  { left: 22%; animation-delay: 1.2s;  width: 5px;  height: 5px; }
.mp-success-particle--10 { left: 60%; animation-delay: 1.5s;  width: 7px;  height: 7px; }

@keyframes mpParticleFloat {
    0%   { opacity: 0;   transform: translateY(0)   scale(1); }
    20%  { opacity: 0.8; }
    80%  { opacity: 0.4; }
    100% { opacity: 0;   transform: translateY(-120px) scale(0.5) rotate(45deg); }
}

/* Dofedex subsection surfaces align with Team/Bestiaire green panels. */
#dofedex-screen #dofedex-main-panel,
#dofedex-screen #dofedex-details-panel-container {
    border: 1px solid rgba(204, 255, 194, 0.18) !important;
    background:
        linear-gradient(180deg, rgba(75, 126, 103, 0.18), rgba(12, 34, 37, 0.34)),
        rgba(7, 26, 27, 0.8) !important;
    box-shadow: inset 0 0 34px rgba(197, 255, 199, 0.08), 0 18px 45px rgba(0, 0, 0, 0.26) !important;
}

#dofedex-screen #dofedex-main-panel .inventory-tabs {
    gap: 7px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(204, 255, 194, 0.14);
    background:
        linear-gradient(180deg, rgba(75, 126, 103, 0.22), rgba(12, 34, 37, 0.18));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#dofedex-screen #dofedex-main-panel .inventory-tab {
    min-height: 32px;
    border: 1px solid rgba(221, 255, 214, 0.24) !important;
    border-radius: 7px !important;
    background:
        linear-gradient(180deg, rgba(92, 150, 124, 0.64), rgba(24, 63, 62, 0.9)) !important;
    color: #f2ffe8 !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -10px 14px rgba(0, 0, 0, 0.18),
        0 5px 12px rgba(0, 0, 0, 0.22);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

#dofedex-screen #dofedex-main-panel .inventory-tab:hover {
    border-color: rgba(235, 255, 123, 0.74) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -10px 14px rgba(0, 0, 0, 0.16),
        0 7px 16px rgba(0, 0, 0, 0.25),
        0 0 16px rgba(216, 255, 133, 0.18);
}

#dofedex-screen #dofedex-main-panel .inventory-tab.active {
    border-color: rgba(255, 243, 107, 0.86) !important;
    background:
        linear-gradient(180deg, rgba(211, 230, 105, 0.82), rgba(65, 117, 76, 0.94)) !important;
    color: #fffbe0 !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        inset 0 -10px 14px rgba(0, 0, 0, 0.16),
        0 0 0 2px rgba(255, 243, 107, 0.22),
        0 0 18px rgba(255, 243, 107, 0.32);
}

#dofedex-screen :is(#dofedex-content-dofemon, #dofedex-content-spells, #dofedex-content-weaknesses, #dofedex-content-achievements) {
    padding: 10px !important;
    border-radius: 8px;
    border: 1px solid rgba(204, 255, 194, 0.12);
    background:
        linear-gradient(180deg, rgba(75, 126, 103, 0.14), rgba(12, 34, 37, 0.22));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#dofedex-screen .dofedex-achievements-title {
    color: #f1c40f;
    margin-bottom: 18px;
}

#dofedex-screen .dofedex-achievement-section {
    margin-bottom: 28px;
}

#dofedex-screen .dofedex-achievement-section-title {
    margin: 0 0 14px 0;
    padding-bottom: 7px;
    border-bottom: 1px solid rgba(241, 196, 15, 0.28);
    color: #f6d778;
    font-size: 14px;
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

#dofedex-screen .dofedex-achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
    gap: 16px 14px;
}

#dofedex-screen .dofedex-achievement-badge {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 7px 5px 8px;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--achievement-color, #f1c40f) 36%, rgba(204, 255, 194, 0.13));
    background:
        radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--achievement-color, #f1c40f) 20%, transparent), transparent 48%),
        linear-gradient(180deg, rgba(75, 126, 103, 0.2), rgba(12, 34, 37, 0.34));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 5px 12px rgba(0, 0, 0, 0.2);
}

#dofedex-screen .dofedex-achievement-medallion {
    width: 82px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(5, 18, 19, 0.18);
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--achievement-color, #f1c40f) 34%, transparent));
}

#dofedex-screen .dofedex-achievement-img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 0;
    object-fit: contain;
}

#dofedex-screen .dofedex-achievement-label {
    width: 100%;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(242, 255, 232, 0.82);
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
    overflow-wrap: anywhere;
}

#dofedex-screen .dofedex-achievement-badge.is-locked {
    border-color: rgba(204, 255, 194, 0.1);
    background:
        linear-gradient(180deg, rgba(75, 126, 103, 0.12), rgba(12, 34, 37, 0.26)),
        rgba(4, 15, 16, 0.58);
}

#dofedex-screen .dofedex-achievement-badge.is-locked .dofedex-achievement-medallion {
    filter: drop-shadow(0 0 5px rgba(204, 255, 194, 0.08));
}

#dofedex-screen .dofedex-achievement-badge.is-locked .dofedex-achievement-img {
    opacity: 0.46;
    filter: grayscale(1) brightness(0.82) contrast(0.9);
}

#dofedex-screen .dofedex-achievement-badge.is-locked .dofedex-achievement-label {
    color: rgba(204, 214, 203, 0.58);
}

#dofedex-screen .dofedex-achievement-count {
    margin-top: 10px;
    padding: 11px 10px;
    border-top: 1px solid rgba(204, 255, 194, 0.16);
    color: rgba(242, 255, 232, 0.62);
    font-size: 13px;
    text-align: center;
}

#dofedex-screen .dofemage-entry,
#dofedex-screen .weakness-cycle-card {
    border-color: rgba(204, 255, 194, 0.2);
    background:
        linear-gradient(180deg, rgba(75, 126, 103, 0.2), rgba(12, 34, 37, 0.34)),
        rgba(7, 26, 27, 0.78);
}

#dofedex-screen .dofedex-entry {
    border-color: rgba(204, 255, 194, 0.26) !important;
    background:
        linear-gradient(180deg, rgba(75, 126, 103, 0.24), rgba(12, 34, 37, 0.42)),
        rgba(7, 26, 27, 0.84) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -18px 26px rgba(0, 0, 0, 0.18),
        0 4px 8px rgba(0, 0, 0, 0.3);
}

#dofedex-screen .dofedex-entry > div:first-child {
    border-color: var(--dofedex-type-color, rgba(221, 255, 214, 0.28)) !important;
    background:
        radial-gradient(circle at 50% 44%, rgba(211, 230, 105, 0.2), transparent 48%),
        linear-gradient(180deg, rgba(92, 150, 124, 0.38), rgba(24, 63, 62, 0.82)) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        inset 0 -14px 20px rgba(0, 0, 0, 0.2),
        0 0 14px color-mix(in srgb, var(--dofedex-type-color, #ddffd6) 45%, transparent),
        0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

#dofedex-screen .dofedex-entry > div:nth-child(2),
#dofedex-screen .dofedex-entry > div:nth-child(3) {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border-radius: 7px;
    border: 1px solid rgba(204, 255, 194, 0.14);
    background:
        linear-gradient(180deg, rgba(75, 126, 103, 0.18), rgba(12, 34, 37, 0.24));
    color: var(--dofedex-type-color, rgba(242, 255, 232, 0.78)) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Auth login final layer: keep this at the end so global screen/button rules cannot flatten it. */
body.auth-screen-active {
    padding: 0 !important;
    overflow: hidden !important;
    background: #07131f !important;
}

body.auth-screen-active #settings-wrapper,
body.auth-screen-active #wallet-address-selector,
body.world-select-active #settings-wrapper,
body.world-select-active #wallet-address-selector,
body.auth-screen-active #world-screen,
body.auth-screen-active #combat-screen,
body.auth-screen-active #starter-screen {
    display: none !important;
    visibility: hidden !important;
}

body.auth-screen-active #auth-screen.screen,
body.world-select-active #world-select-screen.screen {
    position: fixed !important;
    /* Ne pas coller le bas au bord de la WebView : ca passerait sous la barre Phantom.
       Hauteur = zone tappable (--app-height), comme .fullscreen-layer. */
    inset: auto !important;
    top: var(--app-offset-top, 0px) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    z-index: 9000 !important;
    width: 100% !important;
    max-width: none !important;
    height: 100vh !important;
    height: 100dvh !important;
    height: var(--app-height, 100dvh) !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: clamp(18px, 4vh, 42px) 18px !important;
    padding-bottom: max(18px, env(safe-area-inset-bottom, 0px), var(--app-chrome-bottom, 0px)) !important;
    display: flex !important;
    align-items: center !important;
    align-items: safe center !important;
    justify-content: center !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    box-sizing: border-box !important;
    background:
        linear-gradient(180deg, rgba(2, 8, 16, 0.08), rgba(2, 8, 16, 0.44)),
        url("images/backgrounds/auth_wallet_bg.jpeg") center / cover no-repeat !important;
    isolation: isolate !important;
}

/* --app-height a deja retranche le chrome Phantom : ne pas le re-padding. */
html.is-phantom-inapp body.auth-screen-active #auth-screen.screen,
html.is-phantom-inapp body.world-select-active #world-select-screen.screen {
    padding-bottom: 16px !important;
}

body.auth-screen-active #auth-screen::before,
body.world-select-active #world-select-screen::before {
    content: "";
    position: fixed;
    inset: -18px;
    z-index: -3;
    background: url("images/backgrounds/auth_wallet_bg.jpeg") center / cover no-repeat;
    filter: blur(5px) saturate(1.2) brightness(1.08);
    transform: scale(1.035);
}

body.auth-screen-active #auth-screen::after,
body.world-select-active #world-select-screen::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(circle at 50% 20%, rgba(109, 233, 255, 0.14), transparent 32%),
        radial-gradient(circle at 50% 66%, rgba(255, 211, 92, 0.12), transparent 31%),
        linear-gradient(180deg, rgba(4, 14, 25, 0.08), rgba(4, 14, 25, 0.46) 74%, rgba(4, 14, 25, 0.62));
    pointer-events: none;
}

body.auth-screen-active .auth-bg,
body.auth-screen-active .auth-vignette,
body.world-select-active .auth-bg,
body.world-select-active .auth-vignette {
    display: none !important;
}

body.auth-screen-active .auth-content,
body.world-select-active .auth-content {
    width: min(520px, 94vw) !important;
    min-height: 0 !important;
    max-height: 100% !important;
    margin-block: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: clamp(12px, 2vh, 20px) !important;
    transform: none !important;
}

body.auth-screen-active .auth-sr-title,
body.world-select-active .auth-sr-title {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
}

body.auth-screen-active .auth-logo,
body.world-select-active .auth-logo {
    width: min(470px, 86vw) !important;
    max-height: min(38vh, 360px) !important;
    object-fit: contain !important;
    filter:
        drop-shadow(0 14px 22px rgba(0, 0, 0, 0.7))
        drop-shadow(0 0 18px rgba(72, 225, 255, 0.42)) !important;
}

/* Deux cartes monde + logo : 38vh (du 100vh Phantom) poussait Monde 2 sous la barre. */
body.world-select-active .auth-logo {
    max-height: min(28vh, 240px, calc(var(--app-height, 100dvh) * 0.28)) !important;
}

body.auth-screen-active .auth-card,
body.world-select-active .auth-card {
    width: min(430px, 92vw) !important;
    padding: 24px 24px 22px !important;
    border: 1px solid rgba(255, 226, 105, 0.72) !important;
    border-radius: 8px !important;
    background:
        linear-gradient(180deg, rgba(13, 32, 49, 0.76), rgba(6, 17, 31, 0.88)),
        rgba(8, 22, 35, 0.78) !important;
    box-shadow:
        0 20px 48px rgba(0, 0, 0, 0.48),
        0 0 38px rgba(64, 223, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
    backdrop-filter: blur(8px) saturate(1.15) !important;
}

body.auth-screen-active .auth-kicker,
body.world-select-active .auth-kicker {
    color: #78f5ff !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    text-align: center !important;
    text-transform: uppercase !important;
    text-shadow: 0 0 12px rgba(120, 245, 255, 0.75) !important;
}

body.auth-screen-active .auth-card h2,
body.world-select-active .auth-card h2 {
    margin: 0 0 10px !important;
    color: #ffe86d !important;
    font-size: clamp(25px, 4vw, 31px) !important;
    line-height: 1.08 !important;
    text-align: center !important;
    text-shadow: 0 2px 0 #4e2a00, 0 0 18px rgba(255, 232, 109, 0.42) !important;
}

body.auth-screen-active .auth-card > p,
body.world-select-active .auth-card > p {
    margin: 0 0 18px !important;
    color: #ecfbff !important;
    font-size: 15px !important;
    line-height: 1.45 !important;
    text-align: center !important;
}

body.auth-screen-active #auth-screen .auth-wallet-btn,
body.auth-screen-active #auth-screen .auth-phantom-link {
    width: 100% !important;
    min-height: 58px !important;
    margin: 0 0 12px !important;
    padding: 15px 18px !important;
    border: 2px solid rgba(255, 234, 117, 0.9) !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #7d45ff 0%, #20c9ff 52%, #ffd45a 100%) !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 17px !important;
    font-weight: 900 !important;
    text-align: center !important;
    text-decoration: none !important;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45) !important;
    box-shadow:
        0 12px 26px rgba(32, 201, 255, 0.28),
        0 0 18px rgba(255, 212, 90, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.36) !important;
}

body.auth-screen-active #auth-screen .auth-wallet-btn:disabled {
    opacity: 0.92 !important;
    border-color: rgba(255, 234, 117, 0.58) !important;
    background: linear-gradient(135deg, #60517e 0%, #28637a 56%, #8a7842 100%) !important;
}

body.auth-screen-active .auth-install-card {
    margin-top: 14px !important;
    padding-top: 14px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: #d7e9f1 !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
    text-align: center !important;
}

body.auth-screen-active .auth-install-card strong {
    color: #ffe86d !important;
}

body.auth-screen-active .auth-install-card a,
body.auth-screen-active .auth-mobile-hint a {
    color: #76f2ff !important;
    font-weight: 900 !important;
    text-decoration: none !important;
}

@media (max-width: 640px) {
    body.auth-screen-active #auth-screen.screen,
    body.world-select-active #world-select-screen.screen {
        padding: 16px 14px !important;
        padding-bottom: max(16px, env(safe-area-inset-bottom), var(--app-chrome-bottom, 0px)) !important;
    }

    html.is-phantom-inapp body.auth-screen-active #auth-screen.screen,
    html.is-phantom-inapp body.world-select-active #world-select-screen.screen {
        padding-bottom: 16px !important;
    }

    body.auth-screen-active .auth-logo {
        width: min(350px, 88vw) !important;
        max-height: 33svh !important;
    }

    body.world-select-active .auth-logo {
        width: min(350px, 88vw) !important;
        max-height: min(24svh, 180px) !important;
    }

    body.auth-screen-active .auth-card,
    body.world-select-active .auth-card {
        width: min(390px, 94vw) !important;
        padding: 20px 17px !important;
    }
}

/* Combat spell emblem carousel */
#combat-actions-list #actions-container.combat-spell-actions-container {
    flex-direction: row;
    align-items: center;
    gap: 11px;
    padding: 7px 1px 7px 11px;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: none;
}

#combat-actions-list #actions-container.combat-dofemon-actions-container {
    align-items: flex-start;
    padding-top: 5px;
    padding-bottom: 6px;
}

#combat-actions-list #actions-container.combat-spell-labeled-actions-container {
    align-items: flex-start;
    padding-top: 5px;
    padding-bottom: 5px;
}

.combat-spell-emblem-slot {
    width: 83px;
    flex: 0 0 83px;
    display: grid;
    grid-template-rows: 83px 13px;
    justify-items: center;
    align-items: start;
    gap: 4px;
    scroll-snap-align: center;
    box-sizing: border-box;
}

.combat-spell-emblem-slot .combat-spell-emblem-btn {
    flex: none;
    scroll-snap-align: unset;
}

.combat-spell-emblem-label {
    width: 83px;
    max-width: 83px;
    display: block;
    color: #f4f7ff;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    transform: translateY(6px);
    white-space: nowrap;
    overflow: hidden;
    letter-spacing: 0;
    text-shadow:
        0 1px 0 #000,
        1px 0 0 #000,
        -1px 0 0 #000,
        0 0 5px color-mix(in srgb, var(--spell-type-color, #c6ced6) 40%, transparent);
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.combat-spell-emblem-btn {
    width: 83px;
    height: 83px;
    flex: 0 0 83px;
    display: grid;
    place-items: center;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
    padding: 7px;
    border: 3px solid #090c14;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0 12%, transparent 13% 100%),
        linear-gradient(145deg, color-mix(in srgb, var(--spell-type-color, #c6ced6) 28%, #233042 72%), #101620 62%, #070a10);
    box-shadow:
        inset 0 0 0 2px color-mix(in srgb, var(--spell-type-color, #c6ced6) 72%, #ffffff 28%),
        inset 0 0 0 5px #151b26,
        inset 0 -6px 0 rgba(0, 0, 0, 0.34),
        0 6px 0 rgba(0, 0, 0, 0.55),
        0 0 0 2px rgba(0, 0, 0, 0.92),
        0 0 14px color-mix(in srgb, var(--spell-type-color, #c6ced6) 28%, transparent);
    cursor: pointer;
    scroll-snap-align: center;
    touch-action: pan-x;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    transition: transform 0.12s ease, border-color 0.12s ease, filter 0.12s ease;
}

.combat-spell-emblem-btn:hover,
.combat-spell-emblem-btn.is-selected {
    filter: brightness(1.13);
}

.combat-spell-emblem-btn:active {
    transform: translateY(3px);
    box-shadow:
        inset 0 0 0 2px color-mix(in srgb, var(--spell-type-color, #c6ced6) 72%, #ffffff 28%),
        inset 0 0 0 5px #151b26,
        inset 0 -3px 0 rgba(0, 0, 0, 0.36),
        0 3px 0 rgba(0, 0, 0, 0.55),
        0 0 0 2px rgba(0, 0, 0, 0.92),
        0 0 14px color-mix(in srgb, var(--spell-type-color, #c6ced6) 28%, transparent);
}

.combat-spell-emblem-btn.is-selected::after {
    content: "";
    position: absolute;
    inset: 4px;
    border: 2px solid #ffe76a;
    border-radius: 6px;
    box-shadow:
        inset 0 0 0 2px #0b1020,
        inset 0 0 0 4px color-mix(in srgb, var(--spell-type-color, #c6ced6) 74%, #ffffff 26%),
        0 0 10px rgba(255, 231, 106, 0.72),
        0 0 16px color-mix(in srgb, var(--spell-type-color, #c6ced6) 54%, transparent);
    pointer-events: none;
}

.combat-spell-emblem-btn.is-disabled {
    cursor: not-allowed;
    filter: grayscale(0.55) brightness(0.72);
}

.combat-spell-emblem-frame {
    width: 100%;
    height: 100%;
    max-width: 64px;
    max-height: 64px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 6px;
    background: rgba(4, 8, 12, 0.58);
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.combat-spell-emblem-frame img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

.combat-spell-emblem-frame--fallback {
    color: #071018;
    font-size: 32px;
    font-weight: 1000;
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.2) 31%, transparent 35%),
        linear-gradient(145deg, color-mix(in srgb, var(--spell-type-color, #c6ced6) 76%, white 24%), color-mix(in srgb, var(--spell-type-color, #c6ced6) 72%, black 28%));
}

.combat-item-emblem-frame {
    padding: 0;
    box-sizing: border-box;
}

.combat-item-emblem-frame > div,
.combat-item-emblem-frame picture {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.combat-item-emblem-frame .combat-item-emblem-img,
.combat-item-emblem-frame img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    transform: none !important;
}

.combat-item-emblem-frame--fallback {
    font-size: 24px;
}

.combat-spell-cooldown-badge {
    min-width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    position: absolute;
    top: -7px;
    right: -7px;
    padding: 0 5px;
    border: 2px solid #000;
    border-radius: 999px;
    background: #c0392b;
    color: #fff;
    font-size: 12px;
    font-weight: 1000;
    line-height: 1;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.58);
}

.combat-item-quantity-badge {
    min-width: 24px;
    height: 22px;
    display: grid;
    place-items: center;
    position: absolute;
    right: 4px;
    bottom: 4px;
    z-index: 3;
    padding: 0 5px;
    border: 2px solid #06080c;
    border-radius: 999px;
    background:
        linear-gradient(180deg, #fff0a8, #d8a92c 54%, #8e5e0d);
    color: #101018;
    font-size: 9px;
    font-weight: 1000;
    line-height: 1;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.38),
        0 2px 0 rgba(0, 0, 0, 0.58),
        0 0 9px rgba(255, 217, 90, 0.42);
}

.combat-item-detail-popover {
    position: fixed;
    z-index: 1000000;
    width: min(300px, calc(100vw - 20px));
    max-height: min(440px, calc(100vh - 20px));
    overflow-y: auto;
    padding: 8px;
    border: 2px solid color-mix(in srgb, var(--dofemon-theme-bright, #c6ced6) 52%, rgba(255, 255, 255, 0.18));
    border-radius: 8px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--dofemon-theme-bright, #c6ced6) 14%, transparent), rgba(0, 0, 0, 0.12)),
        rgba(2, 8, 14, 0.96);
    color: #f7fbff;
    pointer-events: none;
    touch-action: none;
    box-shadow:
        0 18px 36px rgba(0, 0, 0, 0.72),
        0 0 18px color-mix(in srgb, var(--dofemon-theme-bright, #c6ced6) 24%, transparent);
}

.combat-item-detail-popover .dofemon-detail-card {
    --dofemon-card-ink: #f7fbff;
    --dofemon-card-muted: rgba(236, 246, 255, 0.72);
    --dofemon-card-panel: rgba(14, 26, 36, 0.78);
    --dofemon-card-trim: color-mix(in srgb, var(--dofemon-card-color, #8fb8c8) 76%, white 24%);
    --dofemon-theme-color: var(--dofemon-card-color, #8fb8c8);
    --dofemon-theme-bright: color-mix(in srgb, var(--dofemon-theme-color) 68%, white 32%);
    --dofemon-theme-soft: color-mix(in srgb, var(--dofemon-theme-color) 34%, transparent);
    width: min(100%, 276px);
    margin: 0 auto;
    color: var(--dofemon-card-ink);
    filter: none;
}

.combat-item-detail-popover .dofemon-card-frame {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    padding: 8px;
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.22), transparent 18%),
        radial-gradient(circle at 20% 14%, rgba(255, 255, 255, 0.28), transparent 22%),
        radial-gradient(circle at 82% 18%, var(--dofemon-theme-soft), transparent 32%),
        radial-gradient(circle at 50% 100%, color-mix(in srgb, var(--dofemon-theme-color) 22%, transparent), transparent 38%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 16px),
        linear-gradient(165deg, var(--dofemon-frame-a), var(--dofemon-frame-b) 52%, var(--dofemon-frame-c));
    border: 2px solid color-mix(in srgb, var(--dofemon-theme-bright) 78%, white 22%);
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.12),
        inset 0 -28px 45px rgba(0, 0, 0, 0.34),
        0 0 34px color-mix(in srgb, var(--dofemon-theme-color) 28%, transparent),
        0 18px 38px rgba(0, 0, 0, 0.4);
}

.combat-item-detail-popover .dofemon-card-frame::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--dofemon-theme-bright) 24%, transparent);
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--dofemon-theme-color) 14%, transparent),
        inset 0 0 22px color-mix(in srgb, var(--dofemon-theme-color) 10%, transparent);
    pointer-events: none;
    z-index: 1;
}

.combat-item-detail-popover .dofemon-card-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(112deg, transparent 0 28%, rgba(255, 255, 255, 0.17) 39%, transparent 51%),
        radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.22), transparent 18%),
        radial-gradient(circle at 12% 88%, color-mix(in srgb, var(--dofemon-theme-color) 22%, transparent), transparent 18%);
    mix-blend-mode: screen;
    opacity: 0.5;
    pointer-events: none;
    z-index: 2;
}

.combat-item-detail-popover .dofemon-card-top,
.combat-item-detail-popover .dofemon-card-art,
.combat-item-detail-popover .dofemon-card-body {
    position: relative;
    z-index: 3;
}

.combat-item-detail-popover .dofemon-card-top {
    display: grid;
    align-items: center;
    gap: 8px;
}

.combat-item-detail-popover .dofemon-card-top-badge,
.combat-item-detail-popover .dofemon-card-name {
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--dofemon-card-color, #8fb8c8) 62%, white 20%);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.18)),
        rgba(4, 16, 24, 0.82);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
}

.combat-item-detail-popover .consumable-card-top {
    grid-template-columns: minmax(54px, 0.38fr) minmax(0, 1fr);
    min-height: 32px;
}

.combat-item-detail-popover .consumable-card-quantity {
    justify-self: stretch;
    padding: 7px 6px;
    color: color-mix(in srgb, var(--dofemon-theme-bright) 74%, white 26%);
    font-size: 11px;
}

.combat-item-detail-popover .consumable-card-name {
    min-width: 0;
    justify-self: stretch;
    padding: 7px 7px;
    color: var(--dofemon-card-ink);
    font-size: 11px;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.combat-item-detail-popover .dofemon-card-art {
    min-height: 0;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    margin-top: 9px;
    border: 1px solid color-mix(in srgb, var(--dofemon-theme-bright) 58%, transparent);
    border-radius: 10px;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.14),
        inset 0 -46px 52px rgba(6, 20, 36, 0.56),
        0 0 18px color-mix(in srgb, var(--dofemon-theme-color) 18%, transparent);
}

.combat-item-detail-popover .dofemon-card-art::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-radial-gradient(ellipse at 50% 48%, transparent 0 24px, rgba(255, 255, 255, 0.16) 25px 27px, transparent 28px 44px);
    opacity: 0.62;
    pointer-events: none;
}

.combat-item-detail-popover .dofemon-card-art-glow {
    position: absolute;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--dofemon-card-color, #8fb8c8) 42%, transparent), transparent 68%);
    filter: blur(8px);
}

.combat-item-detail-popover .consumable-detail-card .consumable-card-art {
    height: 146px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--dofemon-theme-color) 12%, transparent), rgba(0, 0, 0, 0.16)),
        radial-gradient(circle at 50% 48%, color-mix(in srgb, var(--dofemon-theme-color) 18%, transparent), transparent 36%),
        var(--item-card-bg-url),
        linear-gradient(155deg, var(--dofemon-frame-a), var(--dofemon-frame-b) 52%, var(--dofemon-frame-c));
    background-size: cover;
    background-position: center;
}

.combat-item-detail-popover .dofemon-card-monster-img {
    position: relative;
    z-index: 2;
    object-fit: contain;
    image-rendering: auto;
    filter:
        drop-shadow(0 10px 12px rgba(0, 0, 0, 0.48))
        drop-shadow(0 0 14px color-mix(in srgb, var(--dofemon-theme-color) 34%, transparent));
}

.combat-item-detail-popover .consumable-card-image,
.combat-item-detail-popover .consumable-card-fallback {
    width: 96px;
    height: 96px;
    object-fit: contain;
}

.combat-item-detail-popover .consumable-card-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 42px;
}

.combat-item-detail-popover .dofemon-card-body {
    margin-top: 10px;
    border: 1px solid color-mix(in srgb, var(--dofemon-theme-bright) 20%, transparent);
    border-radius: 10px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--dofemon-theme-bright) 8%, transparent), rgba(5, 16, 28, 0.08)),
        color-mix(in srgb, var(--dofemon-frame-b) 58%, rgba(8, 18, 28, 0.82));
}

.combat-item-detail-popover .consumable-card-body {
    min-height: auto;
    display: grid;
    align-content: start;
    gap: 6px;
    padding: 8px;
}

.combat-item-detail-popover .consumable-card-description {
    min-height: 64px;
    max-height: 116px;
    overflow-y: auto;
    padding: 8px 9px;
    border-radius: 8px;
    color: rgba(240, 248, 240, 0.9);
    font-size: 10px;
    line-height: 1.35;
    white-space: pre-line;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--dofemon-theme-bright) 7%, transparent), rgba(0, 0, 0, 0.08)),
        rgba(2, 12, 8, 0.36);
    border: 1px solid color-mix(in srgb, var(--dofemon-theme-bright) 18%, rgba(255, 255, 255, 0.1));
}

.combat-dofemon-reserve-slot {
    width: 83px;
    flex: 0 0 83px;
    display: grid;
    grid-template-rows: 15px 83px 13px;
    gap: 4px;
    justify-items: center;
    scroll-snap-align: center;
}

.combat-dofemon-reserve-slot .combat-spell-emblem-label {
    transform: translateY(2px);
}

.combat-dofemon-hp-bar {
    width: 83px;
    height: 15px;
    position: relative;
    justify-self: center;
    box-sizing: border-box;
    overflow: hidden;
    border: 2px solid #07100a;
    border-radius: 5px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.32)),
        #8e1818;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.09),
        0 2px 0 rgba(0, 0, 0, 0.42);
}

.combat-dofemon-hp-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.36), transparent 48%),
        linear-gradient(90deg, #1fbf56, #78e34d);
    box-shadow:
        inset -1px 0 0 rgba(255, 255, 255, 0.18),
        0 0 8px rgba(62, 226, 113, 0.46);
}

.combat-dofemon-hp-bar strong {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #f7ffe9;
    font-size: 9px;
    font-weight: 1000;
    line-height: 1;
    text-shadow:
        0 1px 0 #000,
        0 0 4px rgba(0, 0, 0, 0.9);
    pointer-events: none;
}

.combat-dofemon-reserve-frame img {
    width: 100%;
    height: 100%;
    max-width: 64px;
    max-height: 64px;
    display: block;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.44));
}

.combat-dofemon-reserve-fallback {
    width: 100%;
    height: 100%;
    place-items: center;
    color: color-mix(in srgb, var(--spell-type-color, #7ed284) 74%, white 26%);
    font-size: 32px;
    font-weight: 1000;
    pointer-events: none;
}

.combat-dofemon-reserve-slot.is-ko .combat-dofemon-hp-fill {
    width: 0 !important;
}

.combat-dofemon-reserve-btn.is-ko,
.combat-dofemon-reserve-btn.is-disabled {
    cursor: not-allowed;
    filter: grayscale(0.92) brightness(0.58);
}

.combat-dofemon-reserve-btn.is-ko img,
.combat-dofemon-reserve-btn.is-ko .combat-dofemon-reserve-fallback {
    opacity: 0.48;
}

.combat-spell-detail-popover {
    position: fixed;
    z-index: 1000000;
    width: min(330px, calc(100vw - 20px));
    max-height: min(440px, calc(100vh - 20px));
    overflow-y: auto;
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 2px solid color-mix(in srgb, var(--spell-type-color, #c6ced6) 52%, rgba(255, 255, 255, 0.18));
    border-radius: 8px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--spell-type-color, #c6ced6) 14%, transparent), rgba(0, 0, 0, 0.12)),
        rgba(2, 8, 14, 0.96);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.72), 0 0 18px color-mix(in srgb, var(--spell-type-color, #c6ced6) 24%, transparent);
    color: rgba(235, 245, 255, 0.9);
    font-size: 10px;
    line-height: 1.35;
    pointer-events: none;
}

.combat-spell-detail-popover span,
.combat-spell-detail-popover em {
    display: block;
}

.combat-spell-detail-popover .dofemon-card-spell-detail-header {
    min-width: 0;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.combat-spell-detail-popover .dofemon-card-spell-emblem {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 8px;
    color: #081018;
    font-size: 17px;
    font-weight: 1000;
    line-height: 1;
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.2) 31%, transparent 35%),
        linear-gradient(145deg, color-mix(in srgb, var(--spell-type-color, #c6ced6) 76%, white 24%), color-mix(in srgb, var(--spell-type-color, #c6ced6) 72%, black 28%));
    border: 1px solid color-mix(in srgb, var(--spell-type-color, #c6ced6) 78%, white 22%);
}

.combat-spell-detail-popover .dofemon-card-spell-emblem--image {
    background: rgba(4, 8, 12, 0.64);
}

.combat-spell-detail-popover .dofemon-card-spell-emblem--image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
    border-radius: inherit;
}

.combat-spell-detail-popover .dofemon-card-spell-detail-name {
    min-width: 0;
    overflow: hidden;
    color: color-mix(in srgb, var(--spell-type-color, #c6ced6) 78%, white 22%);
    font-size: 18px;
    font-weight: 1000;
    line-height: 1.2;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.combat-spell-detail-popover .dofemon-card-spell-detail-type {
    min-width: 48px;
    padding: 5px 7px;
    border-radius: 6px;
    color: color-mix(in srgb, var(--spell-type-color, #c6ced6) 78%, white 22%);
    font-size: 9px;
    font-weight: 1000;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    background: color-mix(in srgb, var(--spell-type-color, #c6ced6) 14%, rgba(0, 0, 0, 0.42));
    border: 1px solid color-mix(in srgb, var(--spell-type-color, #c6ced6) 40%, rgba(255, 255, 255, 0.12));
}

.combat-spell-detail-popover .dofemon-card-spell-detail-primary,
.combat-spell-detail-popover .dofemon-card-spell-detail-secondary {
    padding: 6px 8px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.09);
}

.combat-spell-detail-popover .dofemon-card-spell-detail-primary {
    color: rgba(255, 255, 255, 0.96);
    font-size: 14px;
    font-weight: 900;
    text-align: center;
}

.combat-spell-detail-popover .dofemon-card-spell-detail-primary--damage {
    color: color-mix(in srgb, var(--spell-type-color, #c6ced6) 78%, white 22%);
}

.combat-spell-detail-popover .dofemon-card-spell-detail-secondary {
    color: rgba(230, 241, 249, 0.86);
    display: grid;
    gap: 4px;
}

.combat-spell-detail-popover .dofemon-card-spell-detail-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}

.combat-spell-detail-popover .dofemon-card-spell-detail-metrics span {
    min-width: 0;
    padding: 5px;
    border-radius: 6px;
    color: rgba(229, 240, 248, 0.88);
    font-size: 9px;
    font-weight: 800;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.combat-spell-detail-popover .dofemon-card-spell-detail-description {
    padding-top: 7px;
    border-top: 1px solid color-mix(in srgb, var(--spell-type-color, #c6ced6) 16%, transparent);
}

.combat-spell-detail-popover .dofemon-card-spell-detail-description > span {
    margin-bottom: 3px;
    color: color-mix(in srgb, var(--spell-type-color, #c6ced6) 42%, white 58%);
    font-size: 9px;
    font-weight: 1000;
    text-transform: uppercase;
}

.combat-spell-detail-popover .dofemon-card-spell-detail-description p {
    margin: 0;
    color: rgba(226, 238, 246, 0.82);
    font-size: 10px;
}

/* =========================================
   ECRAN DE CHOIX DU MONDE (PLAN_MONDES 6.3)
   Le fond, la vignette, le logo et la carte sont HERITES de l ecran de
   connexion (selecteurs body.world-select-active ajoutes plus haut). Ne sont
   definis ici que les elements propres aux mondes.
   ========================================= */
#world-select-screen {
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    isolation: isolate;
    background: #08111f;
}

.world-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 4px;
}

.world-card {
    display: grid;
    grid-template-columns: 1fr auto;
    /* Zones RECTANGULAIRES obligatoires : une zone en L (ex. status sur les
       lignes 1 et 3 seulement) invalide toute la declaration et fait se
       superposer les enfants. */
    grid-template-areas:
        "name  count"
        "gauge gauge"
        "status status";
    gap: 6px 12px;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    border: 2px solid rgba(255, 231, 111, 0.5);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(18, 38, 60, 0.9), rgba(9, 20, 35, 0.94));
    color: #e8f8ff;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.world-card:not(:disabled):hover {
    transform: translateY(-2px);
    border-color: rgba(255, 234, 117, 0.95);
    box-shadow: 0 12px 26px rgba(32, 201, 255, 0.26), 0 0 20px rgba(255, 212, 90, 0.2);
}

/* Monde memorise / monde courant : mis en avant sans etre impose. */
.world-card.is-preselected {
    border-color: rgba(120, 245, 255, 0.9);
    box-shadow: 0 0 22px rgba(120, 245, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.world-card.is-disabled {
    filter: grayscale(0.55) brightness(0.78);
    cursor: not-allowed;
}

.world-card.is-joining {
    filter: brightness(1.12);
    cursor: progress;
}

.world-card-name {
    grid-area: name;
    color: #ffe86d;
    font-size: 17px;
    font-weight: 900;
    text-shadow: 0 2px 0 #4e2a00;
}

.world-card-status {
    grid-area: status;
    color: #78f5ff;
    font-size: 11px;
    font-weight: 900;
    text-align: right;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(120, 245, 255, 0.6);
}

.world-card.is-disabled .world-card-status {
    color: #ffb4b4;
    text-shadow: none;
}

.world-card.is-current .world-card-status {
    color: #9dff9d;
    text-shadow: 0 0 10px rgba(157, 255, 157, 0.5);
}

/* Jauge de remplissage : verte, puis orange des 80 %, rouge a 50/50. */
.world-card-gauge {
    grid-area: gauge;
    display: block;
    height: 7px;
    border-radius: 999px;
    background: rgba(3, 12, 22, 0.75);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.world-card-gauge-fill {
    display: block;
    height: 100%;
    min-width: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, #35d6a0, #7ef2c8);
    transition: width 0.25s ease;
}

.world-card-gauge-fill.is-crowded {
    background: linear-gradient(90deg, #f6c445, #ffe08a);
}

.world-card-gauge-fill.is-full {
    background: linear-gradient(90deg, #e0574f, #ff9a92);
}

.world-card-count {
    grid-area: count;
    align-self: baseline;
    color: #d8f3ff;
    font-size: 13px;
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .world-card {
        padding: 12px 13px;
    }
    .world-card-name { font-size: 16px; }
    .world-card-status { font-size: 10px; }
}

/* =========================================
   GATE « PAS DE SAVE = PAS DE JEU » (js/save_gate.js)
   =========================================
   Overlay plein ecran affiche quand la progression ne peut plus etre sauvegardee.
   Il doit BLOQUER : c'est tout son role. Le contrat ecrit dans le plan est un
   blocage explicite et total, jamais un avalement silencieux d'actions.
   Meme socle que .boss-intro-overlay (fixed + inset + grid) pour ne pas
   introduire une 2e strategie de positionnement. */
.save-gate-overlay {
    position: fixed;
    top: var(--app-offset-top, 0px);
    left: 0;
    right: 0;
    height: var(--app-height, 100dvh);
    /* Au-dessus de l'intro de boss (10020) : quand les deux sont la, c'est
       celui-ci qui doit parler — l'autre est decoratif. */
    z-index: 10060;
    display: grid;
    place-items: center;
    padding: 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom), var(--app-chrome-bottom, 0px));
    background: rgba(2, 5, 10, 0.88);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    pointer-events: auto;
    touch-action: none;
}

.save-gate-overlay[hidden] {
    display: none;
}

.save-gate-panel {
    max-width: 520px;
    width: 100%;
    box-sizing: border-box;
    padding: 28px 24px;
    border-radius: 14px;
    border: 2px solid #e74c3c;
    background: linear-gradient(180deg, #1b2330 0%, #121821 100%);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6);
    text-align: center;
    color: #ecf0f1;
}

.save-gate-icon {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 10px;
}

.save-gate-title {
    margin: 0 0 12px;
    font-size: 20px;
    color: #e74c3c;
}

.save-gate-message {
    margin: 0 0 12px;
    font-size: 15px;
    line-height: 1.5;
}

.save-gate-hint {
    margin: 0 0 18px;
    font-size: 13px;
    line-height: 1.45;
    opacity: 0.75;
}

.save-gate-retry {
    padding: 11px 22px;
    font-size: 15px;
    font-weight: bold;
    color: #fff;
    background: #e74c3c;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.save-gate-retry:disabled {
    opacity: 0.55;
    cursor: default;
}

/* Overlay « recharge obligatoire » (js/version_check.js). Au-dessus du
   save-gate (10060) et de l'écran d'auth : le seul geste possible est F5. */
.force-reload-overlay {
    position: fixed;
    inset: 0;
    z-index: 10070;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(2, 5, 10, 0.88);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    pointer-events: auto;
    touch-action: none;
}

.force-reload-overlay[hidden] {
    display: none;
}

.force-reload-panel {
    max-width: 520px;
    width: 100%;
    box-sizing: border-box;
    padding: 28px 24px;
    border-radius: 14px;
    border: 2px solid #2980b9;
    background: linear-gradient(180deg, #1b2330 0%, #121821 100%);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6);
    text-align: center;
    color: #ecf0f1;
}

.force-reload-icon {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 10px;
}

.force-reload-title {
    margin: 0 0 12px;
    font-size: 20px;
    color: #5dade2;
}

.force-reload-message {
    margin: 0 0 12px;
    font-size: 15px;
    line-height: 1.5;
}

.force-reload-hint {
    margin: 0 0 18px;
    font-size: 13px;
    line-height: 1.45;
    opacity: 0.75;
}

.force-reload-btn {
    padding: 11px 22px;
    font-size: 15px;
    font-weight: bold;
    color: #fff;
    background: #2980b9;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* La hauteur visible sur iOS n'est PAS 100vh : on s'appuie sur `inset: 0`, qui
   suit le viewport, plutot que sur une hauteur ecrite a la main. */
@media (max-width: 600px) {
    .save-gate-panel { padding: 22px 18px; }
    .save-gate-title { font-size: 18px; }
    .save-gate-message { font-size: 14px; }
}

/* =========================================
   ACCÈS DE ZONE (open world)
   ========================================= */
#zone-access-overlay {
    background: rgba(0, 0, 0, 0.72);
    z-index: 100010;
}

.zone-access-popup {
    background: linear-gradient(160deg, #1e272e 0%, #2c3e50 100%);
    border: 3px solid #7f8c8d;
    border-radius: 20px;
    padding: 28px 26px 24px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    pointer-events: auto;
    text-align: center;
}

.zone-access-icon-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.zone-access-icon {
    width: 72px;
    height: 72px;
    object-fit: contain;
    display: block;
}

.zone-access-title {
    margin: 0 0 14px 0;
    font-size: 1.45em;
    color: #ecf0f1;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.18);
}

.zone-access-message {
    margin: 0 0 22px 0;
    color: #dfe6e9;
    line-height: 1.55;
    font-size: 1.02em;
}

.zone-access-ok {
    background: #7f8c8d;
    border-color: #636e72;
    width: 100%;
    padding: 12px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
}

@media (max-width: 600px) {
    .zone-access-popup { padding: 22px 18px 20px; }
    .zone-access-title { font-size: 1.25em; }
    .zone-access-icon { width: 56px; height: 56px; }
}

/* Faces canvas des boutons sous Samsung Internet (js/night_button_faces.js).
   Samsung assombrit tout ce que peint le CSS, sauf <canvas> : le module recopie
   fond, bordure, ombres intérieures et icônes de chaque bouton dans un canvas
   posé SOUS son contenu, puis efface ici la version CSS. Rien de tout cela ne
   s'applique si le module ne s'est pas activé (html[data-night-faces]).
   - background-clip: text cache le fond sans changer sa valeur calculée
     (le module relit les couleurs à chaque changement d'état) ;
   - border-image transparent cache la bordure sans toucher largeur ni couleur. */
html[data-night-faces] button[data-nbf~="on"] {
    isolation: isolate;
}

html[data-night-faces] button[data-nbf~="pos"] {
    position: relative;
}

html[data-night-faces] [data-nbf~="nobg"] {
    -webkit-background-clip: text !important;
    background-clip: text !important;
}

html[data-night-faces] [data-nbf~="nobd"] {
    border-image: linear-gradient(transparent, transparent) 1 !important;
}

html[data-night-faces] button[data-nbf~="on"] [data-nbf~="img"] {
    visibility: hidden !important;
}

html[data-night-faces] canvas.nbf-face {
    position: absolute !important;
    z-index: -1 !important;
    display: block !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    filter: none !important;
    opacity: 1 !important;
    background: none !important;
    box-shadow: none !important;
    visibility: inherit !important;
}
.bestiary-panorama-button {
    width: 100%; margin: 0 0 12px; padding: 11px 16px; border: 2px solid #9cbf76;
    border-radius: 8px; background: linear-gradient(135deg, #284d42, #3f6950);
    color: #f5edc9; font: inherit; font-weight: 700; cursor: pointer;
}
.bestiary-panorama-button:hover { background: #456f50; }
.bestiary-panorama .panorama-shell {
    display: flex; flex-direction: column; width: min(1200px, 96vw); height: 92%;
    min-height: 0; overflow: hidden; border: 2px solid #9cbf76; border-radius: 18px;
    color: #f5edc9; background: #172f2a; box-shadow: 0 20px 70px #0008;
}
.panorama-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 10px; gap: 12px; }
.panorama-header h2 { margin: 0; font-size: clamp(17px, 3vw, 24px); color: #f5edc9; }
.panorama-header p { margin: 5px 0 0; color: #bfd1a7; font-size: 12px; }
.panorama-harvest { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 20px 12px; }
.panorama-harvest[hidden] { display: none; }
.panorama-harvest [role="status"] { font-size: 12px; color: #f5df97; font-variant-numeric: tabular-nums; }
.bestiary-panorama button[data-action="claim-all"] { display: flex; align-items: center; gap: 7px; flex-shrink: 0; border-color: #d3ad55; background: #715021; }
.panorama-harvest img { width: 23px; height: 23px; image-rendering: pixelated; }
.bestiary-panorama button[data-action="claim-one"] { margin: 0 auto 12px; border-color: #d3ad55; }
.bestiary-panorama button, .bestiary-panorama select {
    border: 1px solid #729573; border-radius: 7px; background: #294b40; color: #fff2ce;
    min-height: 40px; padding: 7px 12px; cursor: pointer; font: inherit;
}
.bestiary-panorama button:hover { background: #456849; }
.bestiary-panorama :focus-visible { outline: 3px solid #f1d486; outline-offset: 2px; }
.panorama-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 0 20px 12px; }
.panorama-toolbar output { min-width: 55px; text-align: center; font-size: 12px; }
.panorama-toolbar select { margin-left: auto; max-width: 260px; min-width: 0; }
.panorama-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #203d35; }
.panorama-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.panorama-stage canvas:active { cursor: grabbing; }
.panorama-empty { position: absolute; left: 10%; right: 10%; top: 50%; text-align: center; pointer-events: none; color: #fff5cf; text-shadow: 0 2px 3px #182d21; }
.panorama-detail { position: absolute; inset: 0; overflow-y: auto; background: #102720eb; padding: 12px 16px 22px; }
.panorama-detail[hidden] { display: none; }
.panorama-detail > button { position: sticky; top: 0; display: block; margin: 0 0 12px auto; z-index: 2; }
.panorama-card { max-width: 420px; margin: auto; isolation: isolate; }
.panorama-card .dofemon-detail-card { width: 100%; }
.bestiary-panorama footer { padding: 10px 20px; color: #bfd1a7; font-size: 12px; text-align: center; }
@media (max-width: 600px) {
    .bestiary-panorama .panorama-shell { width: 100%; height: 100%; border-radius: 0; }
    .panorama-header { padding: 12px; }
    .panorama-harvest { padding: 0 12px 8px; flex-wrap: wrap; }
    .panorama-toolbar { gap: 5px; padding: 0 12px 8px; }
    .panorama-toolbar select { flex: 1 1 100%; max-width: none; }
    .bestiary-panorama footer { padding: 8px 12px; font-size: 11px; }
    .panorama-card .dofemon-card-art { background-image: var(--dofemon-card-mobile-bg-url, var(--dofemon-card-bg-url)); }
}

.bestiary-panorama button[data-action="close"],
.bestiary-panorama button[data-action="detail-close"] {
    color: #fff; background: #b83232; border-color: #f17a70;
    font-size: 24px; font-weight: 700; line-height: 1;
}
.bestiary-panorama button[data-action="close"]:hover,
.bestiary-panorama button[data-action="detail-close"]:hover { background: #db4141; }
.bestiary-panorama button:disabled { opacity: .45; cursor: default; }
.bestiary-panorama button:disabled:hover { background: #294b40; }
/* Reward calendar: uses the Sage panel and existing item detail cards. */
.calendar-tabs { display:flex; gap:12px; flex-wrap:wrap; justify-content:center; margin:20px 0; }
.calendar-tabs .btn { flex:1; width:auto; min-width:130px; text-align:center; background:#364b37; }
.calendar-tabs .btn[aria-pressed="true"] { border-color:#f3cb6e; box-shadow:0 0 0 2px #f3cb6e55; }
#reward-calendar[hidden], #sage-dialogue[hidden], #quest-list[hidden] { display:none; }
#reward-calendar { padding:16px; text-align:center; }
.calendar-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(155px,1fr)); gap:12px; margin:20px 0; }
.calendar-day { padding:14px; border:1px solid #89734c; border-radius:12px; background:linear-gradient(145deg,#302c25,#191c24); color:#f8edcf; }
.calendar-day h3 { margin:0 0 12px; color:#f3cb6e; }
.calendar-day p { font-size:14px; margin:8px 0; overflow-wrap:anywhere; }
.calendar-day.is-current { border:2px solid #f3cb6e; box-shadow:0 0 16px #efbe4733; }
.calendar-day.is-received small { color:#96dca3; display:block; margin-top:10px; }
.calendar-rules,.calendar-end { font-size:13px; line-height:1.6; opacity:.85; }
.calendar-status { font-weight:bold; color:#f3cb6e; }
.calendar-error,.calendar-reset { color:#ffc096; }
.reward-ready-badge { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; margin-left:7px; border-radius:50%; background:#eeae32; color:#231b0c; font:bold 13px sans-serif; text-shadow:none; -webkit-text-stroke:0; box-shadow:0 0 8px #eeae3266; }
#reward-calendar .hero-item-detail-scope { margin:14px auto; max-width:440px; text-align:left; }
@media(max-width:480px) { #reward-calendar { padding:6px; } .calendar-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; } .calendar-day { padding:10px; } }
/* Sage calendar: framed tabs and individual gift tiles. */
#quest-screen .calendar-tabs { width:min(430px,100%); margin:18px auto; gap:7px; padding:8px; border:1px solid #92c99744; border-radius:8px; background:linear-gradient(180deg,#497e503d,#122e242e); box-shadow:inset 0 1px 0 #ffffff12; }
#quest-screen .calendar-tabs .btn { min-height:38px; min-width:0; padding:10px; border:1px solid #b1dfac55; border-radius:7px; background:linear-gradient(180deg,#4c895db8,#1d4933); color:#efffed; font-weight:800; text-transform:uppercase; box-shadow:inset 0 1px 0 #ffffff33,inset 0 -10px 14px #0003,0 5px 12px #0004; }
#quest-screen .calendar-tabs .btn[aria-pressed="true"] { background:linear-gradient(180deg,#80b96c,#315b38); border-color:#d5eaa3; box-shadow:inset 0 1px 0 #ffffff55,0 0 12px #a0d46b33; }
#reward-calendar { color:#f3f7e9; }
#reward-calendar h2 { color:#e6d69b; letter-spacing:.5px; margin:10px 0; }
.calendar-grid { grid-template-columns:repeat(auto-fit,minmax(175px,1fr)); gap:14px; align-items:stretch; }
.calendar-day { display:flex; flex-direction:column; gap:8px; min-width:0; padding:12px; border:1px solid #77956c88; background:linear-gradient(155deg,#34533d,#172b24 65%); box-shadow:inset 0 1px 0 #ffffff16,0 7px 16px #0003; }
.calendar-day h3 { color:#e4edc9; border-bottom:1px solid #b1c88933; padding:4px 0 10px; margin:0; font-size:16px; }
.calendar-day.is-current { border:1px solid #f3cf6c; background:linear-gradient(150deg,#55603c,#20372a 65%); box-shadow:inset 0 0 0 1px #f3cf6c66,0 0 20px #efbe4722; }
.calendar-day.is-received { border-color:#7c9e8277; }
.calendar-gift { display:flex; flex-direction:column; align-items:center; gap:6px; padding:8px 4px; }
.calendar-gift-art { display:grid; place-items:center; width:76px; height:76px; border-radius:16px; background:radial-gradient(ellipse,#d0d7a52b,transparent 70%); }
.calendar-gift-art img { max-width:72px; max-height:72px; object-fit:contain; filter:drop-shadow(0 4px 5px #0006); }
.calendar-gift-fallback { font-size:42px; }
.calendar-gift-label { font-size:13px; line-height:1.4; overflow-wrap:anywhere; }
#reward-calendar .calendar-claim { width:100%; margin: auto 0 0; padding:12px 8px; background:#f1c40f; color:#fff; -webkit-text-stroke:1px #000; text-shadow:1px 1px #000,-1px -1px #000; border:1px solid #ffdc63; border-radius:10px; font-size:15px; font-weight:bold; cursor:pointer; }
#reward-calendar .calendar-claim:disabled { background:#525d55; border-color:#788078; color:#c7cec7; -webkit-text-stroke:0; text-shadow:none; cursor:not-allowed; box-shadow:none; opacity:.75; }
.calendar-status { display:inline-block; padding:10px 18px; border:1px solid #d6b65e55; border-radius:20px; background:#141f18; }
@media(max-width:480px) { .calendar-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; } .calendar-day { padding:8px; } .calendar-gift-art { width:64px; height:64px; } .calendar-gift-art img { max-width:60px; max-height:60px; } }
#reward-calendar .calendar-claim { text-align:center; justify-content:center; }
