/* ======================================================================
   SHADOWSKINGS — MAGE TOWER PANEL
   ARCANE STRONGHOLD THEME
   ====================================================================== */

.mage-tower-panel {
    position: relative;
    width: 100%;
    box-sizing: border-box;

    padding: 20px;

    color: #e9e1ff;

    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(112, 56, 190, 0.18),
            transparent 45%
        ),
        linear-gradient(
            180deg,
            rgba(18, 11, 29, 0.98),
            rgba(8, 6, 14, 0.98)
        );

    border: 1px solid rgba(145, 95, 230, 0.55);
    border-radius: 10px;

    box-shadow:
        0 0 25px rgba(100, 45, 180, 0.30),
        inset 0 0 25px rgba(80, 35, 140, 0.12);

    overflow-y: auto;
}


/* ======================================================================
   HEADER
   ====================================================================== */

.mage-tower-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding-bottom: 16px;
    margin-bottom: 18px;

    border-bottom: 1px solid rgba(150, 100, 230, 0.30);
}


.mage-tower-title-block {
    flex: 1;
    min-width: 0;
}


.mage-tower-panel .section-header {
    margin-bottom: 5px;

    font-size: 22px;
    font-weight: 700;

    color: #f2eaff;

    text-shadow:
        0 0 8px rgba(160, 100, 255, 0.65);
}


.mage-tower-panel .section-subheader {
    font-size: 13px;
    line-height: 1.5;

    color: #bfb1d8;
}


/* ======================================================================
   LEVEL BADGE
   ====================================================================== */

.mage-tower-level-badge {
    flex-shrink: 0;

    min-width: 105px;

    padding: 10px 14px;

    text-align: center;

    background:
        linear-gradient(
            180deg,
            rgba(91, 48, 145, 0.65),
            rgba(37, 19, 62, 0.85)
        );

    border: 1px solid rgba(175, 115, 255, 0.65);
    border-radius: 8px;

    box-shadow:
        0 0 14px rgba(120, 60, 210, 0.30),
        inset 0 0 10px rgba(170, 110, 255, 0.10);
}


.mage-tower-level-label {
    display: block;

    margin-bottom: 3px;

    font-size: 10px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 1px;

    color: #c9b7e8;
}


.mage-tower-level-value {
    display: block;

    font-size: 25px;
    font-weight: 700;

    color: #ffffff;

    text-shadow:
        0 0 8px rgba(185, 125, 255, 0.85);
}


/* ======================================================================
   STAT OVERVIEW
   ====================================================================== */

.mage-tower-stats {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(155px, 1fr)
        );

    gap: 12px;

    margin-bottom: 22px;
}


/* ======================================================================
   STAT CARDS
   ====================================================================== */

.mage-tower-stat-card {
    position: relative;

    min-height: 105px;

    padding: 13px;

    box-sizing: border-box;

    background:
        linear-gradient(
            145deg,
            rgba(50, 26, 80, 0.82),
            rgba(22, 13, 38, 0.92)
        );

    border: 1px solid rgba(125, 75, 195, 0.48);
    border-radius: 7px;

    box-shadow:
        inset 0 0 14px rgba(100, 50, 170, 0.14),
        0 3px 10px rgba(0, 0, 0, 0.22);

    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}


.mage-tower-stat-card:hover {
    transform: translateY(-2px);

    border-color:
        rgba(175, 115, 255, 0.75);

    box-shadow:
        0 0 14px rgba(125, 65, 210, 0.25),
        inset 0 0 14px rgba(100, 50, 170, 0.18);
}


.mage-tower-stat-name {
    margin-bottom: 5px;

    font-size: 11px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.6px;

    color: #bda9dd;
}


.mage-tower-stat-value {
    margin-bottom: 7px;

    font-size: 24px;
    font-weight: 700;

    color: #eee5ff;

    text-shadow:
        0 0 7px rgba(160, 100, 255, 0.55);
}


.mage-tower-stat-description {
    font-size: 11px;
    line-height: 1.4;

    color: #a99bbd;
}


/* ======================================================================
   SECTION TITLES
   ====================================================================== */

.mage-tower-section-title {
    margin-bottom: 11px;

    font-size: 15px;
    font-weight: 700;

    color: #dfd1fa;

    text-shadow:
        0 0 5px rgba(125, 70, 205, 0.40);
}


/* ======================================================================
   TOWER DEVELOPMENT
   ====================================================================== */

.mage-tower-development {
    margin-bottom: 18px;
}


.mage-tower-development-body {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 15px;

    background:
        linear-gradient(
            90deg,
            rgba(42, 22, 69, 0.80),
            rgba(25, 14, 43, 0.88)
        );

    border: 1px solid rgba(130, 80, 205, 0.45);
    border-radius: 8px;
}


.mage-tower-upgrade-info {
    flex: 1;
    min-width: 0;
}


.mage-tower-upgrade-title {
    margin-bottom: 5px;

    font-size: 15px;
    font-weight: 700;

    color: #eee5ff;
}


.mage-tower-upgrade-description {
    max-width: 650px;

    font-size: 12px;
    line-height: 1.5;

    color: #b4a6c8;
}


/* ======================================================================
   UPGRADE BUTTON
   ====================================================================== */

.mage-tower-upgrade-button {
    flex-shrink: 0;

    min-width: 145px;

    padding: 10px 17px;

    cursor: pointer;

    font-size: 13px;
    font-weight: 700;

    color: #f5efff;

    background:
        linear-gradient(
            180deg,
            rgba(111, 58, 180, 0.95),
            rgba(67, 31, 116, 0.95)
        );

    border: 1px solid rgba(185, 125, 255, 0.75);
    border-radius: 6px;

    box-shadow:
        0 0 10px rgba(120, 60, 205, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);

    transition:
        background 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}


.mage-tower-upgrade-button:hover {
    transform: translateY(-1px);

    background:
        linear-gradient(
            180deg,
            rgba(139, 78, 218, 1),
            rgba(83, 40, 140, 1)
        );

    box-shadow:
        0 0 16px rgba(150, 85, 240, 0.55);
}


.mage-tower-upgrade-button:active {
    transform: translateY(0);
}


.mage-tower-upgrade-button:disabled {
    cursor: not-allowed;

    opacity: 0.45;

    transform: none;

    box-shadow: none;
}


/* ======================================================================
   CONSTRUCTION STATUS
   ====================================================================== */

.mage-tower-construction-status {
    margin-bottom: 18px;

    padding: 13px 15px;

    background:
        rgba(52, 29, 82, 0.75);

    border:
        1px solid rgba(155, 100, 235, 0.48);

    border-radius: 7px;

    box-shadow:
        inset 0 0 12px rgba(110, 55, 185, 0.12);
}


.mage-tower-construction-status[hidden] {
    display: none;
}


.mage-tower-construction-title {
    margin-bottom: 4px;

    font-size: 13px;
    font-weight: 700;

    color: #dfd0f8;
}


.mage-tower-construction-message {
    font-size: 12px;

    color: #b5a6ca;
}


/* ======================================================================
   ARCANE INFRASTRUCTURE
   ====================================================================== */

.mage-tower-infrastructure {
    margin-top: 5px;
}


.mage-tower-buildings-list {
    display: flex;
    flex-direction: column;

    gap: 10px;
}


/* ======================================================================
   INFRASTRUCTURE ENTRIES
   ====================================================================== */

.mage-tower-panel .keep-building-entry {
    padding: 12px 14px;

    background:
        linear-gradient(
            90deg,
            rgba(45, 24, 72, 0.72),
            rgba(27, 16, 43, 0.82)
        );

    border:
        1px solid rgba(120, 75, 185, 0.42);

    border-radius: 6px;

    box-shadow:
        inset 0 0 10px rgba(100, 50, 160, 0.10);
}


.mage-tower-panel .building-header {
    display: flex;

    justify-content: space-between;

    gap: 12px;

    margin-bottom: 7px;
}


.mage-tower-panel .building-name {
    font-size: 14px;
    font-weight: 700;

    color: #e7dcfa;
}


.mage-tower-panel .building-effect {
    font-size: 12px;

    color: #c0acd9;
}


.mage-tower-panel .building-desc {
    margin-bottom: 7px;

    font-size: 12px;
    line-height: 1.45;

    color: #aa9bbc;
}


.mage-tower-panel .building-meta {
    display: flex;
    flex-wrap: wrap;

    gap: 12px;

    margin-bottom: 8px;

    font-size: 11px;

    color: #a896bd;
}


/* ======================================================================
   INFRASTRUCTURE BUTTONS
   ====================================================================== */

.mage-tower-panel .building-actions button {
    padding: 7px 12px;

    cursor: pointer;

    font-size: 12px;

    color: #e8dcfa;

    background:
        rgba(76, 39, 125, 0.75);

    border:
        1px solid rgba(150, 95, 225, 0.55);

    border-radius: 5px;

    transition:
        background 0.18s ease,
        border-color 0.18s ease;
}


.mage-tower-panel .building-actions button:hover {
    background:
        rgba(111, 58, 180, 0.90);

    border-color:
        rgba(190, 130, 255, 0.80);
}


/* ======================================================================
   TABLET
   ====================================================================== */

@media (max-width: 900px) {

    .mage-tower-stats {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }


    .mage-tower-development-body {
        align-items:
            flex-start;

        flex-direction:
            column;
    }


    .mage-tower-upgrade-button {
        width: 100%;
    }
}


/* ======================================================================
   MOBILE
   ====================================================================== */

@media (max-width: 600px) {

    .mage-tower-panel {
        padding: 12px;

        font-size: 12px;
    }


    /* ------------------------------------------------------------------
       HEADER
       ------------------------------------------------------------------ */

    .mage-tower-header {
        align-items: stretch;

        flex-direction: column;

        gap: 10px;

        margin-bottom: 14px;

        padding-bottom: 12px;
    }


    .mage-tower-panel .section-header {
        font-size: 19px;
    }


    .mage-tower-panel .section-subheader {
        font-size: 12px;
    }


    /* ------------------------------------------------------------------
       LEVEL
       ------------------------------------------------------------------ */

    .mage-tower-level-badge {
        display: flex;

        align-items: center;
        justify-content: space-between;

        width: 100%;
        min-width: 0;

        box-sizing: border-box;

        text-align: left;
    }


    .mage-tower-level-label {
        margin-bottom: 0;
    }


    .mage-tower-level-value {
        font-size: 21px;
    }


    /* ------------------------------------------------------------------
       STATS
       ------------------------------------------------------------------ */

    .mage-tower-stats {
        grid-template-columns: 1fr;

        gap: 8px;

        margin-bottom: 16px;
    }


    .mage-tower-stat-card {
        min-height: 0;

        padding: 11px;
    }


    .mage-tower-stat-value {
        margin-bottom: 4px;

        font-size: 20px;
    }


    /* ------------------------------------------------------------------
       DEVELOPMENT
       ------------------------------------------------------------------ */

    .mage-tower-development {
        margin-bottom: 14px;
    }


    .mage-tower-development-body {
        gap: 12px;

        padding: 12px;
    }


    .mage-tower-upgrade-title {
        font-size: 14px;
    }


    .mage-tower-upgrade-description {
        font-size: 11px;
    }


    .mage-tower-upgrade-button {
        width: 100%;

        padding: 11px 14px;
    }


    /* ------------------------------------------------------------------
       INFRASTRUCTURE
       ------------------------------------------------------------------ */

    .mage-tower-panel .building-header {
        align-items: flex-start;

        flex-direction: column;

        gap: 3px;
    }


    .mage-tower-panel .building-meta {
        gap: 7px;
    }


    .mage-tower-panel .building-actions button {
        width: 100%;

        padding: 10px 12px;
    }
}