/* --- Iron Man Suit Assembly Styles --- */

#suit-assembly-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 101;
    pointer-events: none;
    display: none;
    isolation: isolate;
}

#suit-assembly-overlay.active {
    display: block;
}

/* Base Plate Style */
.suit-plate {
    position: absolute;
    background: linear-gradient(135deg, #d8d8d8 0%, #b0b0b0 50%, #808080 100%);
    box-shadow:
        inset 1px 1px 2px rgba(255, 255, 255, 0.8),
        inset -1px -1px 5px rgba(0, 0, 0, 0.4),
        0 5px 15px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform, opacity;
}

.suit-plate::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.06) 0%,
        transparent 30%,
        rgba(0, 0, 0, 0.12) 100%);
    opacity: 0.2;
    mix-blend-mode: multiply;
}

/* =========================================
   USER CONFIGURATION AREA
   ========================================= */

/* --- MAIN CHEST --- */
.plate-chest-l {
    width: 300px;
    height: 360px;
    top: 50%;
    left: 50%;
    margin-left: -270px;
    margin-top: -270px;
    clip-path: polygon(19% 0, 89% 0, 89% 30%, 53% 45%, 45% 83%, 30% 100%, 0 49%, 0% 30%);
    transform-origin: bottom right;
    transform: translate(-150px, -50px) scale(0.9);
    z-index: 10;
}

.plate-chest-r {
    width: 300px;
    height: 360px;
    top: 50%;
    left: 50%;
    margin-left: 270px;
    margin-top: -270px;
    clip-path: polygon(19% 0, 89% 0, 89% 30%, 53% 45%, 45% 83%, 30% 100%, 0 49%, 0% 30%);
    transform-origin: bottom left;
    transform: translate(150px, -50px) scale(0.9) scaleX(-1);
    z-index: 10;
}

/* --- UPPER SHOULDER / COLLAR --- */

.plate-shoulder-l {
    width: 350px;
    height: 350px;
    top: 50%;
    left: 50%;

    margin-left: -380px;
    margin-top: -270px;

    clip-path: polygon(19% 0, 67% 0, 39% 28%, 44% 46%, 71% 73%, 50% 100%, 0 80%, 0 25%);
    transform-origin: bottom right;
    transform: translate(-200px, -200px) scale(0.8);
    z-index: 5;
}

.plate-shoulder-r {
    width: 350px;
    height: 350px;
    top: 50%;
    left: 50%;

    margin-left: 380px;
    margin-top: -270px;

    clip-path: polygon(19% 0, 67% 0, 39% 28%, 44% 46%, 71% 73%, 50% 100%, 0 80%, 0 25%);
    transform-origin: bottom left;
    transform: translate(200px, -200px) scale(0.8) scaleX(-1);
    z-index: 5;
}


/* --- ABS --- */
.plate-abs-1 {
    width: 280px;
    height: 70px;
    top: 50%;
    left: 50%;
    margin-left: -140px;
    margin-top: 100px;
    clip-path: polygon(10% 0, 90% 0, 100% 100%, 0 100%);
    transform: translateY(100px) scale(0.9);
}

.plate-abs-2 {
    width: 280px;
    height: 70px;
    top: 50%;
    left: 50%;
    margin-left: -140px;
    margin-top: 175px;
    clip-path: polygon(5% 0, 95% 0, 90% 100%, 10% 100%);
    transform: translateY(150px) scale(0.9);
}

.plate-abs-3 {
    width: 250px;
    height: 80px;
    top: 50%;
    left: 50%;
    margin-left: -125px;
    margin-top: 250px;
    clip-path: polygon(0 0, 100% 0, 85% 100%, 15% 100%);
    transform: translateY(200px) scale(0.9);
}


/* =========================================
   ANIMATION STATES
   ========================================= */

.plate-chest-l.assembled,
.plate-chest-r.assembled,
.plate-abs-1.assembled,
.plate-abs-2.assembled,
.plate-abs-3.assembled,
.plate-shoulder-l.assembled,
.plate-shoulder-r.assembled {
    opacity: 1;
}

.plate-chest-l.assembled {
    transform: translate(0, 0) scale(1) !important;
}

.plate-chest-r.assembled {
    transform: translate(0, 0) scale(1) scaleX(-1) !important;
}

.plate-shoulder-l.assembled {
    transform: translate(0, 0) scale(1) !important;
}

.plate-shoulder-r.assembled {
    transform: translate(0, 0) scale(1) scaleX(-1) !important;
}

.plate-abs-1.assembled {
    transform: translate(0, 0) scale(1) !important;
}

.plate-abs-2.assembled {
    transform: translate(0, 0) scale(1) !important;
}

.plate-abs-3.assembled {
    transform: translate(0, 0) scale(1) !important;
}

.suit-plate.vanish {
    opacity: 0;
    transform: scale(1.5);
    transition: opacity 0.4s ease-in, transform 0.4s ease-in;
}

/* Futuristic suit-up polish: smoother armor + always-visible arc reactor */
#suit-assembly-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 50%, rgba(0, 212, 255, 0.12), transparent 18%),
        radial-gradient(ellipse at center, transparent 38%, rgba(1, 4, 10, 0.55) 100%);
    opacity: 0;
    transition: opacity 0.45s ease-out;
    z-index: 0;
}
#suit-assembly-overlay.active::before { opacity: 1; }

.suit-plate {
    transition:
        transform 0.72s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.38s ease-out,
        filter 0.5s ease-out;
    filter: blur(2px) saturate(1.15) brightness(1.18);
}
.suit-plate.assembled { filter: none; }
.suit-plate.vanish {
    opacity: 0;
    transform: scale(1.36) translateY(-8px);
    filter: blur(8px) brightness(1.8);
    transition:
        opacity 0.52s ease-in,
        transform 0.52s cubic-bezier(0.7, 0, 0.84, 0),
        filter 0.52s ease-in;
}

.suit-arc-reactor {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 148px;
    height: 148px;
    margin-left: -74px;
    margin-top: -74px;
    border-radius: 50%;
    z-index: 100;
    opacity: 0;
    transform: scale(0.76);
    transition:
        opacity 0.42s ease-out,
        transform 0.82s cubic-bezier(0.16, 1, 0.3, 1),
        filter 0.82s ease-out;
    filter: drop-shadow(0 0 24px rgba(0, 212, 255, 0.55));
}
#suit-assembly-overlay.active .suit-arc-reactor {
    opacity: 1;
    transform: scale(1);
}
.suit-arc-reactor::before,
.suit-arc-reactor::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.suit-arc-reactor::before {
    inset: 0;
    background:
        repeating-conic-gradient(from 10deg, rgba(255, 224, 102, 0.98) 0 8deg, rgba(120, 74, 12, 0.98) 8deg 13deg, rgba(255, 224, 102, 0.98) 13deg 21deg, transparent 21deg 45deg),
        radial-gradient(circle, transparent 0 40%, rgba(0, 0, 0, 0.8) 41% 48%, rgba(255, 224, 102, 0.95) 49% 60%, rgba(67, 35, 0, 0.9) 61% 72%, transparent 73%);
    box-shadow:
        inset 0 0 18px rgba(0,0,0,0.75),
        0 0 34px rgba(0, 212, 255, 0.38),
        0 0 78px rgba(0, 212, 255, 0.22);
    animation: reactor-index 10s linear infinite;
}
.suit-arc-reactor::after {
    inset: 42px;
    background: radial-gradient(circle, rgba(255,255,255,1) 0 14%, rgba(206, 249, 255, 0.98) 15% 34%, rgba(0, 212, 255, 0.96) 35% 67%, rgba(0, 84, 110, 0.35) 68% 100%);
    box-shadow:
        inset 0 0 10px rgba(255,255,255,0.95),
        0 0 20px #fff,
        0 0 48px rgba(0, 212, 255, 0.95),
        0 0 120px rgba(0, 212, 255, 0.45);
    animation: chest-core-breathe 1.7s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}
.suit-arc-reactor .reactor-halo {
    position: absolute;
    inset: -34px;
    border-radius: 50%;
    border: 1px solid rgba(0, 212, 255, 0.28);
    box-shadow: inset 0 0 22px rgba(0, 212, 255, 0.18), 0 0 38px rgba(0, 212, 255, 0.22);
    animation: reactor-halo-breathe 2.4s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}
@keyframes reactor-index { to { transform: rotate(360deg); } }
@keyframes chest-core-breathe {
    0%, 100% { transform: scale(0.96); opacity: 0.88; }
    50% { transform: scale(1.08); opacity: 1; }
}
@keyframes reactor-halo-breathe {
    0%, 100% { transform: scale(0.92); opacity: 0.3; }
    50% { transform: scale(1.06); opacity: 0.75; }
}

@media (prefers-reduced-motion: reduce) {
    .suit-plate,
    .suit-arc-reactor,
    .suit-arc-reactor::before,
    .suit-arc-reactor::after,
    .suit-arc-reactor .reactor-halo {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}
