/* =========================================
   1. CONFIGURATION GÉNÉRALE (CORE)
   ========================================= */
html {
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

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) */
    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); }
}

/* =========================================
   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);
}

.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; }
}
@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: 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 */
#minimap-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100005;
    justify-content: center;
    align-items: center;
}

#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;
}

#miniMapCanvasPopup {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    cursor: pointer;
}

/* 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: 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: 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; 
}

@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).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;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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) .dofemage-team-panel,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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) .dofemage-team-panel {
    min-height: 570px;
    display: flex;
    flex-direction: column;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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) .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) .dofemage-team-header > h3:not(.dofemage-title) {
    display: none;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemage-title,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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) .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) .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) .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) .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) .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) .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) .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) .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) .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) .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) .dofemage-avatar-wrap::after {
    content: none;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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) .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) .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) .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) .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) .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) .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) .dofemage-card-name::after {
    content: none;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemage-gender {
    color: #dfff6c;
    font-size: 15px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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) .dofemage-stat-row {
    min-width: 0;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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) .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) .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) .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) .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) .dofemage-hp-bar {
    width: min(100%, 286px);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemage-xp-bar {
    width: min(100%, 254px);
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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) .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) .dofemage-details-content,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) #team-details-panel {
    padding: 18px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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-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-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-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-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-card-top,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-art,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-body,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-footer {
    position: relative;
    z-index: 3;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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-card-top-badge,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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-card-top-badge {
    padding: 8px 7px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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-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-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-card-art::before,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-art::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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-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-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-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-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-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-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-card-art-stats > .dofemon-card-stat-init {
    --stat-color: #42a5ff;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-art-stats > .dofemon-card-stat-mp {
    --stat-color: #3ee37c;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-art-stats > .dofemon-card-stat-force {
    --stat-color: #ffd447;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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-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-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-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-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-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-card-passive.dofemon-card-passive--common {
    --passive-color: #86d68e;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-passive.dofemon-card-passive--rare {
    --passive-color: #4aa9ff;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-passive.dofemon-card-passive--legendary {
    --passive-color: #f3c64b;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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-card-passive-desc,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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-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-card-spells-title {
    margin-top: 9px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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-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-card-spell--fire { --spell-type-color: #ff7045; }
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-spell--water { --spell-type-color: #39a8ff; }
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-spell--grass { --spell-type-color: #42d678; }
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-spell--electric { --spell-type-color: #ffe04f; }
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-spell--wind { --spell-type-color: #9bdcff; }
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-spell--ground { --spell-type-color: #c79a62; }
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-spell--psychic { --spell-type-color: #c77dff; }
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-spell--dark { --spell-type-color: #8d7bff; }
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-spell--light { --spell-type-color: #ffe9a6; }
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-spell--steel { --spell-type-color: #b9c7d4; }
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-spell--dragon { --spell-type-color: #ff9d4d; }
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-spell--normal { --spell-type-color: #c6ced6; }

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-spell:hover,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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-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-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-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-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-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-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-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-card-spell-detail strong,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-spell-detail span,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-spell-detail em {
    display: block;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-spell-detail strong {
    color: #fff;
    font-size: 12px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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-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-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-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-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-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-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-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-card-spell-detail-primary,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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-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-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-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-card-spell-detail-secondary span + span {
    margin-top: 3px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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-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-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-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-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-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-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-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-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-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-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-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-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-card--wind .dofemon-card-top::before,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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-card--wind .dofemon-card-top::before {
    left: -2px;
    top: -25px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card--wind .dofemon-card-footer::before {
    right: 1px;
    bottom: 47px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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-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-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-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-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-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-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-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-card--wind .dofemon-card-spell:hover,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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-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-card--fire {
    --dofemon-card-color: #ff7045;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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-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-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-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-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-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-detail-card .dofemon-card-top::before,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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-detail-card .dofemon-card-top::before {
    left: -2px;
    top: -25px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-detail-card .dofemon-card-footer::before {
    right: 1px;
    bottom: 47px;
}

:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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-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-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-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-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-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-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-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-detail-card .dofemon-card-spell:hover,
:is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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-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-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) .equipment-detail-card {
    width: min(100%, 330px);
    margin-top: 4px;
}

:is(#hub-screen, #shop-screen) .equipment-detail-card .dofemon-card-frame {
    padding: 10px;
}

:is(#hub-screen, #shop-screen) .equipment-card-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 38px;
}

:is(#hub-screen, #shop-screen) .equipment-card-top--single {
    grid-template-columns: 1fr;
}

:is(#hub-screen, #shop-screen) .equipment-card-name {
    justify-self: stretch;
    font-size: 12px;
}

:is(#hub-screen, #shop-screen) .equipment-card-top--single .equipment-card-name {
    text-align: center;
}

:is(#hub-screen, #shop-screen) .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) .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) .equipment-card-image {
    width: 132px;
    height: 132px;
    object-fit: contain;
}

:is(#hub-screen, #shop-screen) .equipment-card-fallback {
    width: 132px;
    height: 132px;
    font-size: 58px;
}

:is(#hub-screen, #shop-screen) .equipment-card-body {
    display: grid;
    gap: 8px;
}

:is(#hub-screen, #shop-screen) .equipment-card-stat-list {
    display: grid;
    gap: 6px;
}

:is(#hub-screen, #shop-screen) .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) .equipment-card-stat-row--pm { --equipment-stat-color: #3ee37c; }
:is(#hub-screen, #shop-screen) .equipment-card-stat-row--hp { --equipment-stat-color: #ff6078; }
:is(#hub-screen, #shop-screen) .equipment-card-stat-row--force { --equipment-stat-color: #ffd447; }
:is(#hub-screen, #shop-screen) .equipment-card-stat-row--init { --equipment-stat-color: #42a5ff; }

:is(#hub-screen, #shop-screen) .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) .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) .equipment-card-attack-title {
    margin-top: 2px;
}

:is(#hub-screen, #shop-screen) .equipment-card-spells {
    grid-template-columns: 1fr;
}

:is(#hub-screen, #shop-screen) .equipment-card-spell {
    cursor: default;
}

:is(#hub-screen, #shop-screen) .equipment-card-spell-detail {
    min-height: 142px;
}

:is(#hub-screen, #shop-screen) .equipment-card-rarity {
    display: flex;
    align-items: flex-end;
}

:is(#hub-screen, #shop-screen) .equipment-card-rarity span {
    margin-left: 0;
}

:is(#hub-screen, #shop-screen) .equipment-card-footer {
    grid-template-columns: 32px minmax(0, 1fr);
}

:is(#hub-screen, #shop-screen) .consumable-detail-card {
    width: min(100%, 330px);
    margin-top: 4px;
}

:is(#hub-screen, #shop-screen) .consumable-detail-card .dofemon-card-frame {
    padding: 10px;
}

:is(#hub-screen, #shop-screen) .consumable-card-top {
    grid-template-columns: minmax(66px, 0.45fr) minmax(0, 1fr);
    min-height: 38px;
}

:is(#hub-screen, #shop-screen) .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) .consumable-card-name {
    justify-self: stretch;
    font-size: 12px;
    text-align: right;
}

:is(#hub-screen, #shop-screen) .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) .consumable-card-image {
    width: 136px;
    height: 136px;
    object-fit: contain;
}

:is(#hub-screen, #shop-screen) .consumable-card-fallback {
    width: 136px;
    height: 136px;
    font-size: 58px;
}

:is(#hub-screen, #shop-screen) .consumable-card-body {
    min-height: 176px;
    display: grid;
    align-content: start;
    gap: 10px;
}

:is(#hub-screen, #shop-screen) .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) .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-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-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-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-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-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-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-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-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-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-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-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) .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) .dofemage-team-panel,
    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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) .dofemage-team-panel {
        min-height: 0;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemage-monster-list {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 12px 8px 16px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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);
        filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.34));
    }

    #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);
    }

    #bestiary-screen.bestiary-mobile-detail-open .dofemon-detail-card {
        width: min(100%, 430px);
        filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.34));
    }

    #bestiary-screen.bestiary-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);
    }

    #bestiary-screen.bestiary-mobile-detail-open .dofemon-detail-card .dofemon-card-frame::after {
        mix-blend-mode: normal;
        opacity: 0.22;
    }

    #bestiary-screen.bestiary-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);
    }

    #bestiary-screen.bestiary-mobile-detail-open .dofemon-detail-card .dofemon-card-art::before {
        opacity: 0.22;
    }

    #bestiary-screen.bestiary-mobile-detail-open .dofemon-card-art-glow {
        filter: none;
        opacity: 0.55;
    }

    #bestiary-screen.bestiary-mobile-detail-open .dofemon-detail-card .dofemon-card-monster-img {
        filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.48));
    }

    #bestiary-screen.bestiary-mobile-detail-open .dofemon-card-top-badge,
    #bestiary-screen.bestiary-mobile-detail-open .dofemon-card-name,
    #bestiary-screen.bestiary-mobile-detail-open .dofemon-card-art-stats > div,
    #bestiary-screen.bestiary-mobile-detail-open .dofemon-card-spell,
    #bestiary-screen.bestiary-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);
    }

    #hub-screen #details-panel-container {
        display: none;
    }

    #hub-screen.hero-item-mobile-detail-open #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;
    }

    #hub-screen.hero-item-mobile-detail-open #details-title {
        display: none;
    }

    #hub-screen.hero-item-mobile-detail-open #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);
    }

    #hub-screen.hero-item-mobile-detail-open .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);
    }

    #hub-screen.hero-item-mobile-detail-open .equipment-detail-card,
    #hub-screen.hero-item-mobile-detail-open .consumable-detail-card {
        width: min(100%, 430px);
        margin: 0 auto;
        filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.34));
    }

    #hub-screen.hero-item-mobile-detail-open .equipment-detail-card .dofemon-card-frame,
    #hub-screen.hero-item-mobile-detail-open .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);
    }

    #hub-screen.hero-item-mobile-detail-open .equipment-detail-card .dofemon-card-frame::after,
    #hub-screen.hero-item-mobile-detail-open .consumable-detail-card .dofemon-card-frame::after {
        mix-blend-mode: normal;
        opacity: 0.2;
    }

    #hub-screen.hero-item-mobile-detail-open .equipment-detail-card .equipment-card-art,
    #hub-screen.hero-item-mobile-detail-open .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 {
        filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.32));
    }

    #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));
    }

    #hub-screen.hero-item-mobile-detail-open .equipment-detail-card .dofemon-card-art::before,
    #hub-screen.hero-item-mobile-detail-open .consumable-detail-card .dofemon-card-art::before {
        opacity: 0.22;
    }

    #hub-screen.hero-item-mobile-detail-open .dofemon-card-art-glow {
        filter: none;
        opacity: 0.5;
    }

    #hub-screen.hero-item-mobile-detail-open .equipment-detail-card .dofemon-card-monster-img,
    #hub-screen.hero-item-mobile-detail-open .consumable-detail-card .dofemon-card-monster-img {
        filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.46));
    }

    #hub-screen.hero-item-mobile-detail-open .dofemon-card-top-badge,
    #hub-screen.hero-item-mobile-detail-open .dofemon-card-name,
    #hub-screen.hero-item-mobile-detail-open .equipment-card-stat-row,
    #hub-screen.hero-item-mobile-detail-open .dofemon-card-spell,
    #hub-screen.hero-item-mobile-detail-open .dofemon-card-spell-detail,
    #hub-screen.hero-item-mobile-detail-open .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);
        filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.34));
    }

    #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) .dofemage-layout {
        width: calc(100vw - 10px);
        margin-top: 12px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemage-team-header {
        padding: 0 8px 10px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemage-title {
        font-size: 18px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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) .dofemage-team-card::before {
        left: 92px;
        right: 18px;
        top: 34px;
        bottom: 25px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemage-team-card::after {
        left: 112px;
        right: 22px;
        bottom: 28px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemage-avatar-wrap {
        left: 12px;
        width: 64px;
        height: 88px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemage-avatar-wrap::before {
        left: -1px;
        top: 7px;
        width: 70px;
        height: 70px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemage-avatar-wrap::after {
        content: none;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemage-creature-sprite,
    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemage-creature-fallback {
        left: 34px;
        top: 42px;
        max-width: 72px;
        max-height: 72px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemage-creature-fallback {
        width: 64px;
        height: 64px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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) .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) .dofemage-bars {
        max-width: none;
        gap: 5px;
        padding-left: 9px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemage-hp-bar {
        width: min(100%, 246px);
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemage-xp-bar {
        width: min(100%, 222px);
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemage-bar-label {
        font-size: 9px;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .dofemon-card-spells {
        grid-template-columns: 1fr;
    }

    :is(#dofemage-screen, #bestiary-screen, #hub-screen, #dofedex-screen, #shop-screen) .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;
}

#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;
    }
}

/* 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(0, 0, 0, 0.95);
    border: 1px solid #f1c40f;
    padding: 8px;
    border-radius: 6px;
    color: white;
    font-size: 9px;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.8);
    white-space: pre-wrap;
    min-width: 180px;
    max-width: 260px;
    backdrop-filter: blur(4px);
    line-height: 1.2;
}

/* 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 {
    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 {
    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 {
    width: min(430px, calc(100% - 28px));
    margin: 0 auto 16px;
}

#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 {
    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 {
    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 {
    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;
}

.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;
}

#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);
    z-index: 100000;
    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%);
    }
    
    .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;
    }
}

/* 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;
    }
    
    .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;
    }
}

/* =========================================
   POP-UP DE VICTOIRE
   ========================================= */
#victory-popup-overlay {
    animation: fadeIn 0.3s ease-out;
}

#victory-popup {
    animation: victoryPopupSlideIn 0.4s ease-out;
}

@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-content {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto auto auto !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;
    }
}

/* =========================================
   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 60 degrés - dimensions augmentées pour garantir le chevauchement */
    /* Pour un angle de 60° : tan(30°) ≈ 0.577 */
    /* Le triangle part du centre (0%, 0%), va à droite (100%, 0%), puis au point calculé */
    /* Pour couvrir exactement 60°, le point en bas doit être à tan(30°) * 100% ≈ 57.7% */
    /* On utilise 75% de taille pour garantir que les sections se chevauchent et éliminent les espaces */
    clip-path: polygon(0% 0%, 100% 0%, 57.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 120° pour orienter le contenu vers l'extérieur */
.item-wheel-section:nth-child(1) > div {
    transform: translate(-50%, -50%) rotate(120deg);
}

.item-wheel-section:nth-child(2) > div {
    transform: translate(-50%, -50%) rotate(120deg);
}

.item-wheel-section:nth-child(3) > div {
    transform: translate(-50%, -50%) rotate(120deg);
}

.item-wheel-section:nth-child(4) > div {
    transform: translate(-50%, -50%) rotate(120deg);
}

.item-wheel-section:nth-child(5) > div {
    transform: translate(-50%, -50%) rotate(120deg);
}

.item-wheel-section:nth-child(6) > div {
    transform: translate(-50%, -50%) rotate(120deg);
}


/* Positionnement des 6 sections en cercle (60 degrés chacune) */
/* Chaque section est un triangle de 60 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(60deg);
}

.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(120deg);
}

.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(180deg);
}

.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(240deg);
}

.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(300deg);
}

.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-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));
    }
}

.wheel-section-label {
    font-size: 13px;
    margin-top: 8px;
    text-align: center;
    font-weight: normal;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

/* =========================================
   MYSTERY BOX SLOT MACHINE
   ========================================= */
.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;
}

/* =========================================
   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 */
}

/* É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: calc(90vh - 62px) !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: 90vh !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
   ========================================= */

.pvp-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    z-index: 100100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.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-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: calc(90vh - 62px) !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: 90vh;
    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;
        max-height: calc(100vh - 115px);
        height: calc(100vh - 115px);
        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 {
    display: none !important;
    visibility: hidden !important;
}

body.auth-screen-active #auth-screen.screen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9000 !important;
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: clamp(18px, 4vh, 42px) 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !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;
}

body.auth-screen-active #auth-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 {
    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 {
    display: none !important;
}

body.auth-screen-active .auth-content {
    width: min(520px, 94vw) !important;
    min-height: 0 !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 {
    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 {
    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;
}

body.auth-screen-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 {
    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 {
    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 {
    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 {
        height: 100svh !important;
        min-height: 100svh !important;
        padding: 16px 14px !important;
    }

    body.auth-screen-active .auth-logo {
        width: min(350px, 88vw) !important;
        max-height: 33svh !important;
    }

    body.auth-screen-active .auth-card {
        width: min(390px, 94vw) !important;
        padding: 20px 17px !important;
    }
}
