/*
 * Armory character / paperdoll CSS
 *
 * Phase 2A :
 * - le vrai CSS personnage est maintenant centralisé ici ;
 * - l'ancien CSS inline dans index.php est encore conservé volontairement ;
 * - le rendu doit donc rester identique ;
 * - prochaine étape : supprimer les blocs personnage inline de index.php après validation.
 */

#armory-tab-character {
    box-sizing: border-box;
}

#armory-tab-character *,
#armory-tab-character *::before,
#armory-tab-character *::after {
    box-sizing: border-box;
}

/* ============================================================
   CHARACTER / PAPERDOLL - bloc historique extrait depuis index.php
   ============================================================ */

.item {
    width: 54px;
    height: 54px;
}

.item a {
    background: none !important;
    width: 54px;
    height: 54px;
    margin: 0;
    position: absolute;
    z-index: 999;
    display: block;
    box-sizing: border-box;
    border: 1px solid #9d9d9d;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.95);
    overflow: hidden;
}

.item a.q0 { border-color: #9d9d9d; }
.item a.q1 { border-color: #ffffff; }
.item a.q2 { border-color: #1eff00; }
.item a.q3 { border-color: #0070dd; }
.item a.q4 { border-color: #a335ee; }
.item a.q5 { border-color: #ff8000; }
.item a.q6 { border-color: #e6cc80; }
.item a.armory-item-quality-0 { border-color: #9d9d9d; }
.item a.armory-item-quality-1 { border-color: #ffffff; }
.item a.armory-item-quality-2 { border-color: #1eff00; }
.item a.armory-item-quality-3 { border-color: #0070dd; }
.item a.armory-item-quality-4 { border-color: #a335ee; }
.item a.armory-item-quality-5 { border-color: #ff8000; }
.item a.armory-item-quality-6 { border-color: #e6cc80; }

/* Wowhead ajoute son propre cadre autour des icônes. On le neutralise ici pour ne garder que l'image + notre bordure fine. */
.item a .iconlarge,
.item a .iconsmall,
.item a .icontiny {
    position: static !important;
    display: block !important;
    width: 52px !important;
    height: 52px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

.item a .iconlarge ins,
.item a .iconsmall ins,
.item a .icontiny ins {
    position: static !important;
    display: block !important;
    width: 52px !important;
    height: 52px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background-size: cover !important;
}

.item a .iconlarge del,
.item a .iconsmall del,
.item a .icontiny del,
.item a .iconlarge b,
.item a .iconsmall b,
.item a .icontiny b {
    display: none !important;
}

.item.armory-empty-item-slot {
    box-sizing: border-box;
    border: 1px solid #6f6f6f;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.95);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.35);
}

.item.armory-empty-item-slot img {
    display: block;
    width: 52px;
    height: 52px;
    margin: 0;
    padding: 0;
    border: 0;
}


#armory_name {
	float:left;
	margin-top:-8px;
}


#armory {
        width:900px;
	margin-left:auto;
	margin-right:auto;
	min-height:512px;
	background-position:top center;
	background-repeat:no-repeat;
}


.armory_current_tab {
	font-weight:bold;
	color:#fff !important;
}


#armory_left {
	float:left;
	margin-left:40px;
	margin-top:15px;
	width:68px;
}

#armory_3d_viewer {
        float:left;
        width:540px;
        height:470px;
        margin-top:-38px;
        margin-left:62px;
        margin-right:-20px;
        box-sizing:border-box;
        border:1px solid rgba(180, 145, 75, 0.55);
        background:rgba(0, 0, 0, 0.38);
        box-shadow:0 0 18px rgba(0, 0, 0, 0.85) inset, 0 0 10px rgba(0, 0, 0, 0.75);
        color:#d8c28a;
        text-align:center;
        text-shadow:1px 1px 2px #000;
        position:relative;
        overflow:hidden;
}


.armory-3d-title {
        display:block;
        font-size:20px;
        color:#f5d07b;
        margin-bottom:10px;
}

.armory-3d-status {
        display:block;
        font-size:13px;
        color:#c9b98c;
        line-height:1.5;
}

.armory-3d-debug {
        display:block;
        margin-top:10px;
        font-size:12px;
        color:#9f9068;
}

.armory-3d-canvas {
        position:absolute;
        left:0;
        top:0;
        width:100%;
        height:100%;
        display:block;
        z-index:1;
}

.armory-3d-overlay {
        position:absolute;
        left:20px;
        right:20px;
        bottom:18px;
        z-index:2;
        padding:10px 12px;
        background:rgba(0, 0, 0, 0.45);
        border:1px solid rgba(180, 145, 75, 0.35);
        box-shadow:0 0 12px rgba(0,0,0,0.65);
}


#armory_left .item,
#armory_right .item {
	margin-bottom:8px;
}

#armory_left .item:last-child,
#armory_right .item:last-child {
	margin-bottom:0;
}

#armory_right {
	float:left;
	margin-top:15px;
	margin-left:0;
	width:70px;
}

#armory_bottom .item {
	float:left;
	margin-right:12px;
}

#armory_bottom .item:last-child {
	margin-right:0;
}

#armory_bottom {
	clear:both;
	margin-left:auto;
	margin-right:auto;
	width:222px;
	height:70px;
}

#tab_armory_1, #tab_armory_2, #tab_armory_3 {
	width:367px;
}

/* Mobile paperdoll rules intentionally removed from armory-character.css.
   Mobile/tablet paperdoll layout is owned by armory-responsive-mobile.css. */

/* ============================================================
   END CHARACTER / PAPERDOLL - bloc historique extrait depuis index.php
   ============================================================ */

/* ============================================================
   CHARACTER / PAPERDOLL - bloc moderne scopé extrait depuis index.php
   ============================================================ */

/* Armory paperdoll spacing after removing the center stats block */
#armory {
    position: relative !important;
}


#armory_left {
    position: absolute !important;
    left: 215px !important;
    top: 0 !important;
    float: none !important;
    margin-left: 0 !important;
    margin-top: 15px !important;
}

#armory_right {
    position: absolute !important;
    left: 620px !important;
    top: 0 !important;
    float: none !important;
    margin-left: 0 !important;
    margin-top: 15px !important;
}

#armory_bottom {
    position: absolute !important;
    left: 412px !important;
    top: 490px !important;
    float: none !important;
    margin-left: 0 !important;
}

/* Paperdoll 3-column layout: left slots / character image / right slots */
#armory {
    position: relative !important;
    width: 650px !important;
    height: 560px !important;
    margin: 35px auto 0 !important;
    background-position: center top !important;
    background-repeat: no-repeat !important;
    background-size: auto 520px !important;
}

#armory_left,
#armory_right,
#armory_bottom {
    float: none !important;
}

#armory_left {
    position: absolute !important;
    top: 0 !important;
    left: -10px !important;
    width: 68px !important;
    margin: 0 !important;
}

#armory_right {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    width: 68px !important;
    margin: 0 !important;
}

#armory_bottom {
    position: absolute !important;
    left: 50% !important;
    bottom: 0 !important;
    transform: translateX(-50%) !important;
    width: auto !important;
    margin: 0 !important;
    text-align: center !important;
    white-space: nowrap !important;
}


#armory_left .item,
#armory_right .item {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

#armory_bottom .item {
    display: inline-block !important;
    float: none !important;
    margin: 0 5px !important;
}


/* Armory paperdoll vertical spacing */
#armory {
    padding-top: 40px !important;
}


/* === Armory 3D paperdoll layout override START === */
/*
 * Layout paperdoll 3D Miorey.
 * Objectif:
 * - colonnes équipement à gauche/droite hors du viewer;
 * - ligne d'armes/bijoux du bas plus basse;
 * - viewer central plus grand;
 * - aucune modification JS / mapping.
 */
#armory-tab-character #armory {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 56px minmax(820px, 820px) 56px !important;
    grid-template-areas:
        "paperleft viewer paperright"
        ". bottom ." !important;
    justify-content: center !important;
    align-items: start !important;
    column-gap: 8px !important;
    row-gap: 18px !important;
    width: 100% !important;
    max-width: 1000px !important;
    min-height: 910px !important;
    margin: 34px auto 72px auto !important;
    padding: 0 !important;
    overflow: visible !important;
    background-size: 820px 795px !important;
    background-position: center top !important;
    background-repeat: no-repeat !important;
}

#armory-tab-character #armory_left {
    grid-area: paperleft !important;
    position: static !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 7px !important;
    width: 56px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: translateX(-10px) !important;
    z-index: 5 !important;
}

#armory-tab-character #armory_right {
    grid-area: paperright !important;
    position: static !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 7px !important;
    width: 56px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: translateX(10px) !important;
    z-index: 5 !important;
}

#armory-tab-character #armory_3d_viewer {
    grid-area: viewer !important;
    position: relative !important;
    width: 820px !important;
    height: 795px !important;
    min-width: 820px !important;
    min-height: 795px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    z-index: 2 !important;
}

#armory-tab-character #armory_wmv_container,
#armory-tab-character #armory_3d_viewer > div:not(.armory-3d-overlay) {
    width: 100% !important;
    height: 100% !important;
}

#armory-tab-character #armory_3d_viewer canvas,
#armory-tab-character #armory_3d_viewer .armory-3d-canvas {
    width: 100% !important;
    height: 100% !important;
}

#armory-tab-character #armory_bottom {
    grid-area: bottom !important;
    position: static !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 14px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: translateY(8px) !important;
    z-index: 5 !important;
}

#armory-tab-character #armory_left .item,
#armory-tab-character #armory_right .item,
#armory-tab-character #armory_bottom .item {
    width: 54px !important;
    height: 54px !important;
    min-width: 54px !important;
    min-height: 54px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

#armory-tab-character #armory_left .item img,
#armory-tab-character #armory_right .item img,
#armory-tab-character #armory_bottom .item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Tablet/mobile paperdoll overrides intentionally removed from armory-character.css.
   armory-responsive-mobile.css is the only owner below desktop widths. */

/* === Armory 3D paperdoll layout override END === */


/* === Armory 3D uniform model scale START === */
/*
 * Réduction proportionnelle du rendu 3D.
 * Ne pas utiliser generateModels(scale) pour ça : il déforme le modèle.
 */
#armory-tab-character #armory_wmv_container canvas {
    transform: scale(0.78) !important;
    transform-origin: center center !important;
}

/* ============================================================
   END CHARACTER / PAPERDOLL - bloc moderne scopé extrait depuis index.php
   ============================================================ */

/* Armory stuff icons visual scale - reversible patch BEGIN
   Objectif:
   - agrandir seulement le rendu visuel des icônes stuff;
   - garder les slots/espacements actuels;
   - limiter au paperdoll personnage: gauche, droite, bas.
*/
#armory-tab-character #armory_left .item > a,
#armory-tab-character #armory_right .item > a,
#armory-tab-character #armory_bottom .item > a,
#armory-tab-character #armory_left .item.armory-empty-item-slot > img,
#armory-tab-character #armory_right .item.armory-empty-item-slot > img,
#armory-tab-character #armory_bottom .item.armory-empty-item-slot > img {
    transform: scale(1.12) !important;
    transform-origin: center center !important;
    position: relative !important;
    z-index: 2 !important;
}

#armory-tab-character #armory_left .item,
#armory-tab-character #armory_right .item,
#armory-tab-character #armory_bottom .item {
    overflow: visible !important;
}
/* Armory stuff icons visual scale - reversible patch END */

/* Armory stuff icons real size - reversible patch BEGIN
   Objectif:
   - agrandir réellement les slots/icônes du paperdoll;
   - ne plus utiliser transform: scale(), qui faisait chevaucher les icônes;
   - conserver les marges/espacements CSS existants entre les slots.
*/
#armory-tab-character #armory_left .item,
#armory-tab-character #armory_right .item,
#armory-tab-character #armory_bottom .item {
    width: 60px !important;
    height: 60px !important;
    overflow: visible !important;
}

#armory-tab-character #armory_left .item > a,
#armory-tab-character #armory_right .item > a,
#armory-tab-character #armory_bottom .item > a,
#armory-tab-character #armory_left .item.armory-empty-item-slot > img,
#armory-tab-character #armory_right .item.armory-empty-item-slot > img,
#armory-tab-character #armory_bottom .item.armory-empty-item-slot > img {
    width: 58px !important;
    height: 58px !important;
    transform: none !important;
}

#armory-tab-character #armory_left .item a .iconlarge,
#armory-tab-character #armory_right .item a .iconlarge,
#armory-tab-character #armory_bottom .item a .iconlarge,
#armory-tab-character #armory_left .item a .iconmedium,
#armory-tab-character #armory_right .item a .iconmedium,
#armory-tab-character #armory_bottom .item a .iconmedium,
#armory-tab-character #armory_left .item a .iconsmall,
#armory-tab-character #armory_right .item a .iconsmall,
#armory-tab-character #armory_bottom .item a .iconsmall,
#armory-tab-character #armory_left .item a .icontiny,
#armory-tab-character #armory_right .item a .icontiny,
#armory-tab-character #armory_bottom .item a .icontiny {
    width: 58px !important;
    height: 58px !important;
    background-size: 58px 58px !important;
    transform: none !important;
}

#armory-tab-character #armory_left .item a .iconlarge ins,
#armory-tab-character #armory_right .item a .iconlarge ins,
#armory-tab-character #armory_bottom .item a .iconlarge ins,
#armory-tab-character #armory_left .item a .iconmedium ins,
#armory-tab-character #armory_right .item a .iconmedium ins,
#armory-tab-character #armory_bottom .item a .iconmedium ins,
#armory-tab-character #armory_left .item a .iconsmall ins,
#armory-tab-character #armory_right .item a .iconsmall ins,
#armory-tab-character #armory_bottom .item a .iconsmall ins,
#armory-tab-character #armory_left .item a .icontiny ins,
#armory-tab-character #armory_right .item a .icontiny ins,
#armory-tab-character #armory_bottom .item a .icontiny ins {
    width: 58px !important;
    height: 58px !important;
    background-size: 58px 58px !important;
}
/* Armory stuff icons real size - reversible patch END */

/* phase-armory-hide-slots-layout-v6-20260611 */
#armory {
    position: relative;
}

#armory .armory-3d-options {
    position: absolute;
    left: calc(50% + 34px);
    top: 22px;
    transform: translateX(-50%);
    z-index: 30;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 10px 16px;
    width: 660px;
    max-width: calc(100% - 240px);
    margin: 0;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(5, 10, 18, 0.78);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
    box-sizing: border-box;
}

#armory .armory-3d-options-title {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
    color: rgba(255, 255, 255, 0.88);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}

#armory .armory-3d-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    flex: 0 0 auto;
    color: rgba(255, 255, 255, 0.84);
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

#armory .armory-3d-option input {
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
}

#armory .armory-3d-option:hover {
    color: #fff;
}

@media (max-width: 900px) {
    #armory .armory-3d-options {
        width: auto;
        max-width: calc(100% - 24px);
        flex-wrap: wrap;
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        margin: 0 auto 10px auto;
    }
}

/* phase-armory-3d-loading-mask-theme-i18n-v2-20260611 */
#armory_3d_viewer {
    position: relative;
}

#armory_3d_viewer #armory_wmv_container {
    transition: opacity 0.42s ease, visibility 0.42s ease, filter 0.42s ease;
}

#armory_3d_viewer.armory-3d-loading #armory_wmv_container {
    opacity: 0;
    visibility: hidden;
    filter: blur(3px);
    pointer-events: none;
}

#armory_3d_viewer.armory-3d-ready #armory_wmv_container {
    opacity: 1;
    visibility: visible;
    filter: none;
}

#armory_3d_viewer .armory-3d-loading-mask {
    position: absolute;
    inset: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 50% 42%, rgba(58, 93, 155, 0.24), rgba(4, 8, 18, 0.86) 54%, rgba(1, 3, 9, 0.94) 100%),
        linear-gradient(135deg, rgba(255, 210, 91, 0.05), rgba(71, 132, 255, 0.08));
    opacity: 1;
    visibility: visible;
    transition: opacity 0.42s ease, visibility 0.42s ease;
    pointer-events: none;
    overflow: hidden;
}

#armory_3d_viewer .armory-3d-loading-mask::before,
#armory_3d_viewer .armory-3d-loading-mask::after {
    content: "";
    position: absolute;
    width: 68%;
    height: 1px;
    left: 16%;
    background: linear-gradient(90deg, transparent, rgba(255, 213, 95, 0.28), transparent);
}

#armory_3d_viewer .armory-3d-loading-mask::before {
    top: 22%;
}

#armory_3d_viewer .armory-3d-loading-mask::after {
    bottom: 22%;
}

#armory_3d_viewer.armory-3d-ready .armory-3d-loading-mask {
    opacity: 0;
    visibility: hidden;
}

#armory_3d_viewer .armory-3d-loading-frame {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 330px;
    max-width: 82%;
    padding: 18px 22px;
    border: 1px solid rgba(255, 213, 95, 0.26);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(14, 22, 38, 0.88), rgba(4, 8, 16, 0.82)),
        rgba(5, 10, 18, 0.78);
    box-shadow:
        0 18px 42px rgba(0, 0, 0, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 38px rgba(255, 213, 95, 0.07);
    backdrop-filter: blur(6px);
}

#armory_3d_viewer .armory-3d-loading-rune {
    position: relative;
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
}

#armory_3d_viewer .armory-3d-loading-ring,
#armory_3d_viewer .armory-3d-loading-core {
    position: absolute;
    inset: 0;
    display: block;
    border-radius: 50%;
}

#armory_3d_viewer .armory-3d-loading-ring {
    border: 2px solid rgba(255, 213, 95, 0.18);
    border-top-color: rgba(255, 213, 95, 0.95);
    border-right-color: rgba(72, 139, 255, 0.65);
    box-shadow:
        0 0 18px rgba(255, 213, 95, 0.16),
        inset 0 0 12px rgba(72, 139, 255, 0.12);
    animation: armory3dRuneSpin 1.05s linear infinite;
}

#armory_3d_viewer .armory-3d-loading-core {
    inset: 13px;
    background:
        radial-gradient(circle, rgba(255, 236, 153, 0.94), rgba(255, 183, 55, 0.58) 42%, rgba(47, 112, 224, 0.18) 72%, transparent 100%);
    box-shadow: 0 0 24px rgba(255, 213, 95, 0.34);
    animation: armory3dRunePulse 1.25s ease-in-out infinite;
}

#armory_3d_viewer .armory-3d-loading-copy {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

#armory_3d_viewer .armory-3d-loading-title {
    color: #fff4bf;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.055em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
    white-space: nowrap;
}

#armory_3d_viewer .armory-3d-loading-text {
    color: rgba(222, 232, 255, 0.78);
    font-size: 12px;
    line-height: 1.35;
}

@keyframes armory3dRuneSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes armory3dRunePulse {
    0%, 100% {
        opacity: 0.62;
        transform: scale(0.86);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 760px) {
    #armory_3d_viewer .armory-3d-loading-frame {
        flex-direction: column;
        min-width: 220px;
        padding: 16px 18px;
        text-align: center;
    }

    #armory_3d_viewer .armory-3d-loading-title {
        white-space: normal;
    }
}


/* patch-armory-viewer-remove-shell-frame-v1
 * Supprime le vieux shell sombre/borduré du viewer 3D.
 * Le fond race reste porté par background-image: var(--armory-bg-image).
 */
#armory-tab-character #armory_3d_viewer {
    border: 0 !important;
    background-color: transparent !important;
    background-image: var(--armory-bg-image) !important;
    box-shadow: none !important;
}


/* patch-armory-static-loader-before-viewer-v1
 * Pendant le chargement initial, ne pas afficher le grand fond race nu.
 * Le loader statique/JS est la seule couche visible avant le canvas WMV.
 */
#armory-tab-character #armory_3d_viewer.armory-3d-loading {
    background-image: none !important;
    background-color: transparent !important;
}

#armory-tab-character #armory_3d_viewer.armory-3d-ready {
    background-image: var(--armory-bg-image) !important;
    background-color: transparent !important;
}

/* patch-armory-remove-top-blue-gap-v1
 * Supprime la bande bleue visible au-dessus du viewer.
 * Cause: le wrapper paperdoll #armory avait margin-top: 34px.
 */
#armory-tab-character #armory {
    margin-top: 0 !important;
}


/* patch-armory-desktop-remove-parent-bg-v1 */
@media (min-width: 761px) {
    /*
     * Desktop: le parent #armory ne doit plus porter le fond 3D.
     * Le fond race doit être rendu uniquement par #armory_3d_viewer.
     * Cela évite le débordement visuel du grand background 820x795 autour/au-dessus du viewer.
     */
    #armory-tab-character #armory {
        background-image: none !important;
        background-color: transparent !important;
        background-size: auto !important;
        background-position: center top !important;
        background-repeat: no-repeat !important;
    }

    #armory-tab-character #armory_3d_viewer {
        background-color: transparent !important;
        background-image: var(--armory-bg-image) !important;
        background-size: cover !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
    }
}
/* /patch-armory-desktop-remove-parent-bg-v1 */

