/* ========================================================================== */
/* SHADOWSKINGS — STRONGHOLD COMMAND CENTER                                  */
/* KEEP PANEL — FULL CLEAN CSS                                                */
/* ========================================================================== */

:root {
    --keep-bg-0: #07070b;
    --keep-bg-1: #0d0c12;
    --keep-bg-2: #15111c;
    --keep-bg-3: #1d1528;

    --keep-panel:
        rgba(15, 12, 21, 0.96);

    --keep-panel-soft:
        rgba(27, 20, 36, 0.82);

    --keep-panel-hover:
        rgba(44, 29, 58, 0.92);

    --keep-purple:
        #7a39b8;

    --keep-purple-bright:
        #a967e8;

    --keep-purple-soft:
        rgba(122, 57, 184, 0.35);

    --keep-gold:
        #d9b45d;

    --keep-gold-bright:
        #f0d58b;

    --keep-gold-soft:
        rgba(217, 180, 93, 0.28);

    --keep-red:
        #9e3545;

    --keep-red-bright:
        #d35a6d;

    --keep-green:
        #58a66a;

    --keep-blue:
        #557fc1;

    --keep-text:
        #e9e2f2;

    --keep-text-soft:
        #bdb2c8;

    --keep-text-muted:
        #81768c;

    --keep-border:
        rgba(139, 94, 182, 0.32);

    --keep-border-soft:
        rgba(255, 255, 255, 0.07);

    --keep-shadow:
        0 0 28px rgba(0, 0, 0, 0.72);

    --keep-radius:
        8px;

    --keep-radius-small:
        5px;

    --keep-transition:
        160ms ease;
}


/* ========================================================================== */
/* MAIN KEEP PANEL                                                            */
/* ========================================================================== */

.keep-panel {
    position: relative;

    display: flex;
    flex-direction: column;

    width: 100%;
    height: 100%;

    min-width: 0;
    min-height: 0;

    overflow: hidden;

    color:
        var(--keep-text);

    background:
        radial-gradient(
            circle at 50% -20%,
            rgba(104, 44, 151, 0.16),
            transparent 42%
        ),
        linear-gradient(
            180deg,
            rgba(14, 11, 19, 0.98),
            rgba(6, 6, 10, 0.99)
        );

    border:
        1px solid
        rgba(126, 70, 171, 0.5);

    box-shadow:
        inset 0 0 55px rgba(93, 37, 130, 0.08),
        var(--keep-shadow);

    font-family:
        "Segoe UI",
        Arial,
        sans-serif;

    font-size:
        13px;
}


/* ========================================================================== */
/* PANEL CLOSE BUTTON                                                         */
/* ========================================================================== */

.keep-panel .panel-close-btn,
.keep-close-btn {
    position: absolute;

    top: 12px;
    right: 15px;

    z-index: 100;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    padding: 0;

    border:
        1px solid
        rgba(162, 101, 202, 0.38);

    border-radius:
        4px;

    color:
        #d8c8e8;

    background:
        rgba(22, 15, 29, 0.88);

    box-shadow:
        inset 0 0 8px rgba(126, 58, 177, 0.08);

    font-size:
        25px;

    line-height:
        1;

    cursor:
        pointer;

    transition:
        var(--keep-transition);
}

.keep-panel .panel-close-btn:hover,
.keep-close-btn:hover {
    color:
        #ffffff;

    border-color:
        rgba(189, 121, 239, 0.72);

    background:
        rgba(77, 37, 101, 0.92);

    box-shadow:
        0 0 11px rgba(146, 69, 202, 0.34);
}


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

.keep-command-header {
    position: relative;

    flex: 0 0 auto;

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

    gap: 20px;

    min-height: 88px;

    padding:
        15px
        60px
        15px
        20px;

    border-bottom:
        1px solid
        rgba(134, 76, 176, 0.32);

    background:
        linear-gradient(
            90deg,
            rgba(32, 20, 42, 0.98),
            rgba(15, 12, 22, 0.96)
        );

    box-shadow:
        inset 0 -1px 0 rgba(255, 255, 255, 0.025);
}

.keep-command-header-left {
    min-width: 0;
}

.keep-command-eyebrow {
    margin-bottom:
        2px;

    color:
        var(--keep-purple-bright);

    font-size:
        10px;

    font-weight:
        800;

    letter-spacing:
        0.22em;

    text-transform:
        uppercase;
}

.keep-command-title {
    margin:
        0;

    color:
        #f2e9fa;

    font-size:
        clamp(21px, 2vw, 31px);

    font-weight:
        800;

    letter-spacing:
        0.055em;

    line-height:
        1.1;

    text-transform:
        uppercase;

    text-shadow:
        0 0 12px rgba(151, 78, 205, 0.18);
}

.keep-command-subtitle {
    margin-top:
        5px;

    color:
        var(--keep-text-soft);

    font-size:
        11px;

    letter-spacing:
        0.025em;
}

.keep-command-header-right {
    display:
        grid;

    grid-template-columns:
        repeat(3, minmax(95px, 1fr));

    gap:
        8px;

    min-width:
        min(360px, 40vw);
}

.keep-header-status {
    padding:
        8px 10px;

    border:
        1px solid
        rgba(126, 73, 162, 0.25);

    border-radius:
        var(--keep-radius-small);

    background:
        rgba(12, 10, 17, 0.7);

    text-align:
        center;
}

.keep-header-status-label {
    color:
        var(--keep-text-muted);

    font-size:
        9px;

    font-weight:
        700;

    letter-spacing:
        0.09em;

    text-transform:
        uppercase;
}

.keep-header-status-value {
    margin-top:
        3px;

    color:
        var(--keep-gold-bright);

    font-size:
        16px;

    font-weight:
        800;

    text-shadow:
        0 0 8px rgba(217, 180, 93, 0.16);
}


/* ========================================================================== */
/* RESOURCE STRIP                                                             */
/* ========================================================================== */

.keep-resource-strip {
    flex:
        0 0 auto;

    display:
        grid;

    grid-template-columns:
        repeat(6, minmax(90px, 1fr));

    gap:
        1px;

    border-bottom:
        1px solid
        rgba(122, 65, 166, 0.26);

    background:
        rgba(0, 0, 0, 0.38);
}

.keep-resource-item {
    display:
        flex;

    align-items:
        center;

    gap:
        8px;

    min-width:
        0;

    padding:
        8px 10px;

    border-right:
        1px solid
        rgba(255, 255, 255, 0.045);

    background:
        linear-gradient(
            180deg,
            rgba(29, 21, 36, 0.88),
            rgba(17, 14, 23, 0.9)
        );
}

.keep-resource-item:last-child {
    border-right:
        0;
}

.keep-resource-symbol {
    flex:
        0 0 28px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    width:
        28px;

    height:
        28px;

    border:
        1px solid
        rgba(255, 255, 255, 0.11);

    border-radius:
        50%;

    color:
        #eee;

    background:
        rgba(0, 0, 0, 0.35);

    font-size:
        10px;

    font-weight:
        900;
}

.keep-resource-gold {
    color:
        #f3d77b;

    border-color:
        rgba(217, 180, 93, 0.36);
}

.keep-resource-food {
    color:
        #9ac16b;

    border-color:
        rgba(113, 161, 77, 0.34);
}

.keep-resource-wood {
    color:
        #b68a61;

    border-color:
        rgba(163, 112, 72, 0.35);
}

.keep-resource-stone {
    color:
        #b5b5bd;

    border-color:
        rgba(170, 170, 180, 0.3);
}

.keep-resource-iron {
    color:
        #c6cbd2;

    border-color:
        rgba(148, 158, 171, 0.32);
}

.keep-resource-mana {
    color:
        #ba7ee8;

    border-color:
        rgba(169, 103, 232, 0.4);
}

.keep-resource-content {
    min-width:
        0;
}

.keep-resource-label {
    color:
        var(--keep-text-muted);

    font-size:
        8px;

    font-weight:
        800;

    letter-spacing:
        0.08em;

    text-transform:
        uppercase;
}

.keep-resource-value {
    margin-top:
        1px;

    overflow:
        hidden;

    color:
        #e9e3ee;

    font-size:
        13px;

    font-weight:
        800;

    text-overflow:
        ellipsis;

    white-space:
        nowrap;
}


/* ========================================================================== */
/* KINGDOM STATUS BAR                                                         */
/* ========================================================================== */

.keep-kingdom-status-bar {
    flex:
        0 0 auto;

    display:
        grid;

    grid-template-columns:
        repeat(5, minmax(110px, 1fr));

    border-bottom:
        1px solid
        rgba(124, 65, 168, 0.28);

    background:
        rgba(10, 8, 14, 0.86);
}

.keep-kingdom-status-block {
    padding:
        8px 12px;

    border-right:
        1px solid
        rgba(255, 255, 255, 0.045);

    text-align:
        center;
}

.keep-kingdom-status-block:last-child {
    border-right:
        0;
}

.keep-kingdom-status-title {
    color:
        var(--keep-purple-bright);

    font-size:
        8px;

    font-weight:
        800;

    letter-spacing:
        0.1em;

    text-transform:
        uppercase;
}

.keep-kingdom-status-main {
    margin-top:
        2px;

    color:
        #f0e8f7;

    font-size:
        14px;

    font-weight:
        800;
}

.keep-status-divider {
    margin:
        0 3px;

    color:
        #665b70;
}

.keep-kingdom-status-caption {
    margin-top:
        1px;

    color:
        #736a7d;

    font-size:
        8px;
}


/* ========================================================================== */
/* TAB BAR                                                                    */
/* ========================================================================== */

.keep-tab-bar {
    flex:
        0 0 auto;

    display:
        flex;

    align-items:
        center;

    gap:
        4px;

    min-height:
        43px;

    padding:
        6px 10px;

    overflow-x:
        auto;

    overflow-y:
        hidden;

    border-bottom:
        1px solid
        rgba(127, 68, 170, 0.3);

    background:
        linear-gradient(
            180deg,
            rgba(27, 19, 34, 0.96),
            rgba(14, 11, 19, 0.98)
        );

    scrollbar-width:
        thin;

    scrollbar-color:
        rgba(129, 69, 172, 0.55)
        rgba(0, 0, 0, 0.2);
}

.keep-tab-bar::-webkit-scrollbar {
    height:
        5px;
}

.keep-tab-bar::-webkit-scrollbar-track {
    background:
        rgba(0, 0, 0, 0.2);
}

.keep-tab-bar::-webkit-scrollbar-thumb {
    background:
        rgba(129, 69, 172, 0.55);

    border-radius:
        4px;
}

.keep-tab {
    flex:
        0 0 auto;

    min-width:
        max-content;

    padding:
        7px 12px;

    border:
        1px solid
        rgba(122, 69, 159, 0.25);

    border-radius:
        4px;

    color:
        #a99cb4;

    background:
        rgba(26, 19, 33, 0.72);

    font-family:
        inherit;

    font-size:
        9px;

    font-weight:
        800;

    letter-spacing:
        0.065em;

    text-transform:
        uppercase;

    cursor:
        pointer;

    transition:
        var(--keep-transition);
}

.keep-tab:hover {
    color:
        #e5d9ee;

    border-color:
        rgba(159, 87, 210, 0.52);

    background:
        rgba(62, 35, 78, 0.86);
}

.keep-tab.active {
    color:
        #ffffff;

    border-color:
        rgba(173, 97, 224, 0.75);

    background:
        linear-gradient(
            180deg,
            rgba(116, 54, 157, 0.94),
            rgba(69, 34, 93, 0.96)
        );

    box-shadow:
        0 0 10px rgba(134, 57, 190, 0.22);

    text-shadow:
        0 0 6px rgba(255, 255, 255, 0.15);
}


/* ========================================================================== */
/* THRONE ROOM — CROWN COMMAND                                                */
/* ========================================================================== */

.keep-tab-throne {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 125px;

    padding: 7px 16px;

    border:
        1px solid
        rgba(217, 180, 93, 0.58);

    border-radius: 4px;

    color: #f0d58b;

    background:
        linear-gradient(
            180deg,
            rgba(58, 29, 78, 0.96),
            rgba(28, 17, 38, 0.98)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 225, 150, 0.05),
        inset 0 0 12px rgba(151, 78, 205, 0.10),
        0 0 7px rgba(122, 57, 184, 0.10);

    font-weight: 900;
    letter-spacing: 0.075em;
    text-transform: uppercase;

    text-shadow:
        0 0 7px rgba(217, 180, 93, 0.24);

    cursor: pointer;

    transition:
        var(--keep-transition);
}


/* CROWN */

.keep-tab-throne::before {
    content: "â™›";

    margin-right: 7px;

    color: #f0d58b;

    font-size: 13px;
    line-height: 1;

    text-shadow:
        0 0 8px rgba(217, 180, 93, 0.48);
}


/* TOP GOLD ACCENT */

.keep-tab-throne::after {
    content: "";

    position: absolute;

    top: -1px;
    left: 12px;
    right: 12px;

    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(240, 213, 139, 0.85),
            transparent
        );

    pointer-events: none;
}


/* HOVER */

.keep-tab-throne:hover {
    color: #fff1c2;

    border-color:
        rgba(240, 213, 139, 0.92);

    background:
        linear-gradient(
            180deg,
            rgba(91, 43, 122, 0.98),
            rgba(48, 24, 65, 0.98)
        );

    box-shadow:
        0 0 13px rgba(153, 78, 205, 0.30),
        inset 0 0 13px rgba(169, 103, 232, 0.12);

    text-shadow:
        0 0 8px rgba(240, 213, 139, 0.42);

    transform:
        translateY(-1px);
}

.keep-tab-throne:hover::before {
    color: #fff1b8;

    text-shadow:
        0 0 11px rgba(240, 213, 139, 0.72);
}


/* ACTIVE */

.keep-tab-throne.active {
    color: #fff4cf;

    border-color: #d9b45d;

    background:
        linear-gradient(
            180deg,
            rgba(116, 54, 157, 0.98),
            rgba(67, 32, 91, 0.99)
        );

    box-shadow:
        0 0 15px rgba(154, 72, 211, 0.32),
        inset 0 0 14px rgba(240, 213, 139, 0.08);

    text-shadow:
        0 0 8px rgba(240, 213, 139, 0.42);
}

.keep-tab-throne.active::before {
    color: #fff0ad;

    text-shadow:
        0 0 12px rgba(240, 213, 139, 0.78);
}


/* PRESSED */

.keep-tab-throne:active {
    transform:
        translateY(1px);

    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.45);
}

/* ========================================================================== */
/* COMMAND BODY                                                               */
/* ========================================================================== */

.keep-command-body {
    flex:
        1 1 auto;

    display:
        grid;

    grid-template-columns:
        220px minmax(0, 1fr);

    min-width:
        0;

    min-height:
        0;

    overflow:
        hidden;
}


/* ========================================================================== */
/* COMMAND RAIL                                                               */
/* ========================================================================== */

.keep-command-rail {
    min-width:
        0;

    min-height:
        0;

    padding:
        10px;

    overflow-x:
        hidden;

    overflow-y:
        auto;

    border-right:
        1px solid
        rgba(121, 66, 162, 0.25);

    background:
        linear-gradient(
            180deg,
            rgba(17, 13, 22, 0.98),
            rgba(9, 8, 13, 0.98)
        );
}

.keep-rail-panel {
    margin-bottom:
        9px;

    padding:
        10px;

    border:
        1px solid
        rgba(122, 69, 160, 0.2);

    border-radius:
        5px;

    background:
        rgba(26, 19, 33, 0.68);

    box-shadow:
        inset 0 0 12px rgba(105, 48, 145, 0.035);
}

.keep-rail-panel:last-child {
    margin-bottom:
        0;
}

.keep-rail-title {
    margin-bottom:
        8px;

    padding-bottom:
        6px;

    border-bottom:
        1px solid
        rgba(139, 79, 181, 0.18);

    color:
        #c5a7dc;

    font-size:
        9px;

    font-weight:
        900;

    letter-spacing:
        0.09em;

    text-transform:
        uppercase;
}

.keep-power-row,
.keep-rail-stat {
    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        8px;

    min-width:
        0;

    padding:
        4px 0;

    color:
        #8e8299;

    font-size:
        9px;
}

.keep-power-row + .keep-power-row,
.keep-rail-stat + .keep-rail-stat {
    border-top:
        1px solid
        rgba(255, 255, 255, 0.035);
}

.keep-power-label {
    min-width:
        0;

    overflow:
        hidden;

    text-overflow:
        ellipsis;

    white-space:
        nowrap;
}

.keep-power-value,
.keep-rail-stat strong {
    flex:
        0 0 auto;

    color:
        #ddd1e6;

    font-size:
        10px;

    font-weight:
        800;
}

.keep-power-row-total {
    margin-top:
        4px;

    padding-top:
        7px;

    border-top:
        1px solid
        rgba(217, 180, 93, 0.18) !important;
}

.keep-power-row-total .keep-power-label {
    color:
        var(--keep-gold);
}

.keep-power-row-total .keep-power-value {
    color:
        var(--keep-gold-bright);

    font-size:
        12px;
}


/* ========================================================================== */
/* DEVELOPMENT METERS                                                         */
/* ========================================================================== */

.keep-meter-block {
    margin-bottom:
        9px;
}

.keep-meter-block:last-child {
    margin-bottom:
        0;
}

.keep-meter-header {
    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        8px;

    margin-bottom:
        4px;

    color:
        #8f8399;

    font-size:
        8px;
}

.keep-meter-header span:last-child {
    color:
        #cfc1da;

    font-weight:
        800;
}

.keep-meter-track {
    position:
        relative;

    width:
        100%;

    height:
        5px;

    overflow:
        hidden;

    border:
        1px solid
        rgba(122, 72, 156, 0.18);

    border-radius:
        5px;

    background:
        rgba(0, 0, 0, 0.45);
}

.keep-meter-fill {
    width:
        0%;

    height:
        100%;

    border-radius:
        inherit;

    background:
        linear-gradient(
            90deg,
            #5b287f,
            #a45cce
        );

    box-shadow:
        0 0 5px rgba(152, 78, 202, 0.24);

    transition:
        width 260ms ease;
}


/* ========================================================================== */
/* CONTENT STAGE                                                              */
/* ========================================================================== */

.keep-content-stage {
    min-width:
        0;

    min-height:
        0;

    overflow:
        hidden;

    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(102, 46, 143, 0.06),
            transparent 35%
        ),
        rgba(8, 7, 11, 0.8);
}

.keep-dynamic-container {
    width:
        100%;

    height:
        100%;

    min-width:
        0;

    min-height:
        0;

    padding:
        14px;

    overflow-x:
        hidden;

    overflow-y:
        auto;

    color:
        var(--keep-text);
}


/* ========================================================================== */
/* SCROLLBARS                                                                 */
/* ========================================================================== */

.keep-dynamic-container,
.keep-command-rail,
.keep-subpanel {
    scrollbar-width:
        thin;

    scrollbar-color:
        rgba(126, 67, 168, 0.56)
        rgba(0, 0, 0, 0.22);
}

.keep-dynamic-container::-webkit-scrollbar,
.keep-command-rail::-webkit-scrollbar,
.keep-subpanel::-webkit-scrollbar {
    width:
        7px;
}

.keep-dynamic-container::-webkit-scrollbar-track,
.keep-command-rail::-webkit-scrollbar-track,
.keep-subpanel::-webkit-scrollbar-track {
    background:
        rgba(0, 0, 0, 0.22);
}

.keep-dynamic-container::-webkit-scrollbar-thumb,
.keep-command-rail::-webkit-scrollbar-thumb,
.keep-subpanel::-webkit-scrollbar-thumb {
    border-radius:
        6px;

    background:
        rgba(126, 67, 168, 0.56);
}


/* ========================================================================== */
/* OVERVIEW SHELL                                                             */
/* ========================================================================== */

.keep-overview-shell {
    display:
        flex;

    flex-direction:
        column;

    gap:
        12px;

    min-width:
        0;
}

.keep-overview-banner {
    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        16px;

    padding:
        14px 16px;

    border:
        1px solid
        rgba(134, 75, 174, 0.26);

    border-radius:
        6px;

    background:
        linear-gradient(
            90deg,
            rgba(36, 24, 46, 0.9),
            rgba(20, 15, 28, 0.88)
        );

    box-shadow:
        inset 0 0 18px rgba(119, 52, 162, 0.04);
}

.keep-overview-banner-copy {
    min-width:
        0;
}

.keep-overview-banner-status {
    flex:
        0 0 auto;

    display:
        flex;

    align-items:
        center;

    gap:
        6px;

    padding:
        6px 9px;

    border:
        1px solid
        rgba(80, 147, 91, 0.26);

    border-radius:
        4px;

    color:
        #8fbc96;

    background:
        rgba(29, 62, 35, 0.2);

    font-size:
        8px;

    font-weight:
        800;

    letter-spacing:
        0.06em;

    text-transform:
        uppercase;
}

.keep-status-indicator,
.keep-footer-indicator {
    display:
        inline-block;

    width:
        6px;

    height:
        6px;

    border-radius:
        50%;

    background:
        #62b56f;

    box-shadow:
        0 0 6px rgba(98, 181, 111, 0.62);
}


/* ========================================================================== */
/* SECTION HEADERS                                                            */
/* ========================================================================== */

.section-header {
    margin:
        0 0 4px 0;

    padding-left:
        9px;

    border-left:
        2px solid
        var(--keep-purple-bright);

    color:
        #e9ddf2;

    font-size:
        13px;

    font-weight:
        900;

    letter-spacing:
        0.075em;

    line-height:
        1.2;

    text-transform:
        uppercase;

    text-shadow:
        0 0 7px rgba(148, 71, 201, 0.14);
}

.section-subheader {
    margin:
        0;

    color:
        #8d8198;

    font-size:
        9px;

    line-height:
        1.45;
}


/* ========================================================================== */
/* COMMAND SECTIONS                                                           */
/* ========================================================================== */

.keep-command-section {
    min-width:
        0;

    padding:
        12px;

    border:
        1px solid
        rgba(126, 71, 163, 0.18);

    border-radius:
        6px;

    background:
        rgba(18, 14, 24, 0.72);
}

.keep-command-section-header {
    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        10px;

    margin-bottom:
        10px;

    padding-bottom:
        8px;

    border-bottom:
        1px solid
        rgba(131, 73, 169, 0.14);
}

.keep-command-section-title {
    color:
        #c9b4d9;

    font-size:
        10px;

    font-weight:
        900;

    letter-spacing:
        0.09em;

    text-transform:
        uppercase;
}

.keep-command-section-subtitle {
    margin-top:
        2px;

    color:
        #746b7d;

    font-size:
        8px;
}


/* ========================================================================== */
/* FACILITY GRID                                                              */
/* ========================================================================== */

.keep-facility-grid {
    display:
        grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap:
        8px;

    min-width:
        0;
}

.keep-facility-grid-small {
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
}

.keep-facility-card {
    position:
        relative;

    display:
        flex;

    align-items:
        stretch;

    gap:
        9px;

    min-width:
        0;

    min-height:
        110px;

    padding:
        10px;

    overflow:
        hidden;

    border:
        1px solid
        rgba(127, 73, 162, 0.23);

    border-radius:
        5px;

    color:
        inherit;

    background:
        linear-gradient(
            135deg,
            rgba(33, 23, 42, 0.92),
            rgba(17, 14, 23, 0.94)
        );

    box-shadow:
        inset 0 0 14px rgba(113, 50, 151, 0.025);

    font-family:
        inherit;

    text-align:
        left;

    cursor:
        pointer;

    transition:
        transform var(--keep-transition),
        border-color var(--keep-transition),
        background var(--keep-transition),
        box-shadow var(--keep-transition);
}

.keep-facility-card:hover {
    transform:
        translateY(-1px);

    border-color:
        rgba(162, 88, 210, 0.54);

    background:
        linear-gradient(
            135deg,
            rgba(52, 32, 65, 0.96),
            rgba(24, 17, 31, 0.96)
        );

    box-shadow:
        0 0 11px rgba(123, 53, 170, 0.12),
        inset 0 0 16px rgba(126, 55, 170, 0.045);
}

.keep-facility-icon {
    flex:
        0 0 42px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    width:
        42px;

    height:
        42px;

    border:
        1px solid
        rgba(154, 91, 195, 0.31);

    border-radius:
        4px;

    color:
        #b88bd6;

    background:
        rgba(9, 8, 13, 0.72);

    font-size:
        8px;

    font-weight:
        900;

    letter-spacing:
        0.03em;

    text-align:
        center;
}

.keep-facility-content {
    flex:
        1 1 auto;

    display:
        flex;

    flex-direction:
        column;

    min-width:
        0;
}

.keep-facility-title {
    color:
        #e2d5eb;

    font-size:
        10px;

    font-weight:
        900;

    letter-spacing:
        0.045em;

    text-transform:
        uppercase;
}

.keep-facility-description {
    flex:
        1 1 auto;

    margin-top:
        4px;

    color:
        #82778c;

    font-size:
        8px;

    line-height:
        1.4;
}

.keep-facility-footer {
    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        7px;

    margin-top:
        7px;

    padding-top:
        6px;

    border-top:
        1px solid
        rgba(255, 255, 255, 0.045);

    color:
        #6e6576;

    font-size:
        7px;

    text-transform:
        uppercase;
}

.keep-facility-footer strong {
    color:
        #cbbbd6;

    font-size:
        8px;

    font-weight:
        900;
}


/* ========================================================================== */
/* PRIMARY FACILITY CARD                                                      */
/* ========================================================================== */

.keep-facility-card-primary {
    border-color:
        rgba(217, 180, 93, 0.34);

    background:
        linear-gradient(
            135deg,
            rgba(51, 37, 28, 0.92),
            rgba(25, 18, 24, 0.95)
        );
}

.keep-facility-card-primary:hover {
    border-color:
        rgba(230, 197, 113, 0.62);

    box-shadow:
        0 0 12px rgba(217, 180, 93, 0.12);
}

.keep-facility-card-primary .keep-facility-icon {
    color:
        var(--keep-gold-bright);

    border-color:
        rgba(217, 180, 93, 0.34);
}


/* ========================================================================== */
/* DANGER FACILITY CARD                                                       */
/* ========================================================================== */

.keep-facility-card-danger {
    border-color:
        rgba(159, 53, 69, 0.34);

    background:
        linear-gradient(
            135deg,
            rgba(50, 23, 30, 0.92),
            rgba(24, 15, 20, 0.95)
        );
}

.keep-facility-card-danger:hover {
    border-color:
        rgba(211, 90, 109, 0.58);

    box-shadow:
        0 0 12px rgba(170, 49, 69, 0.13);
}

.keep-facility-card-danger .keep-facility-icon {
    color:
        #d97988;

    border-color:
        rgba(181, 62, 82, 0.38);
}


/* ========================================================================== */
/* THRONE ROOM OVERVIEW CARD                                                  */
/* ========================================================================== */

.keep-throne-card {
    position:
        relative;

    overflow:
        hidden;

    border-color:
        rgba(217, 180, 93, 0.55);

    background:
        linear-gradient(
            135deg,
            rgba(68, 48, 31, 0.96),
            rgba(31, 22, 27, 0.97)
        );

    box-shadow:
        inset 0 0 22px rgba(217, 180, 93, 0.06),
        0 0 12px rgba(217, 180, 93, 0.08);
}

.keep-throne-card::before {
    content:
        "";

    position:
        absolute;

    top:
        0;

    left:
        0;

    right:
        0;

    height:
        2px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(217, 180, 93, 0.4),
            rgba(240, 213, 139, 0.95),
            rgba(217, 180, 93, 0.4),
            transparent
        );

    pointer-events:
        none;
}

.keep-throne-card::after {
    content:
        "?";

    position:
        absolute;

    top:
        7px;

    right:
        10px;

    color:
        rgba(240, 213, 139, 0.18);

    font-size:
        34px;

    line-height:
        1;

    pointer-events:
        none;

    text-shadow:
        0 0 12px rgba(217, 180, 93, 0.12);
}

.keep-throne-card:hover {
    transform:
        translateY(-2px);

    border-color:
        rgba(240, 213, 139, 0.82);

    background:
        linear-gradient(
            135deg,
            rgba(91, 65, 38, 0.98),
            rgba(42, 28, 32, 0.98)
        );

    box-shadow:
        0 0 18px rgba(217, 180, 93, 0.24),
        inset 0 0 22px rgba(240, 213, 139, 0.07);
}

.keep-throne-card .keep-facility-icon {
    color:
        var(--keep-gold-bright);

    border-color:
        rgba(217, 180, 93, 0.55);

    background:
        radial-gradient(
            circle at center,
            rgba(129, 91, 42, 0.42),
            rgba(16, 12, 13, 0.94)
        );

    box-shadow:
        inset 0 0 12px rgba(217, 180, 93, 0.09),
        0 0 8px rgba(217, 180, 93, 0.08);

    text-shadow:
        0 0 8px rgba(240, 213, 139, 0.38);
}

.keep-throne-card .keep-facility-title {
    color:
        #f5dfaa;

    text-shadow:
        0 0 8px rgba(217, 180, 93, 0.2);
}

.keep-throne-card .keep-facility-footer {
    border-top-color:
        rgba(217, 180, 93, 0.2);
}

.keep-throne-card .keep-facility-footer strong {
    color:
        var(--keep-gold-bright);
}


/* ========================================================================== */
/* CROWN COMMAND SECTION                                                      */
/* ========================================================================== */

.keep-command-section:has(.keep-throne-card) {
    border-color:
        rgba(217, 180, 93, 0.25);

    background:
        linear-gradient(
            135deg,
            rgba(28, 21, 20, 0.82),
            rgba(13, 10, 19, 0.78)
        );

    box-shadow:
        inset 0 0 24px rgba(217, 180, 93, 0.025);
}

.keep-command-section:has(.keep-throne-card)
.keep-command-section-title {
    color:
        var(--keep-gold-bright);
}

.keep-command-section:has(.keep-throne-card)
.keep-command-section-header {
    border-bottom-color:
        rgba(217, 180, 93, 0.19);
}


/* ========================================================================== */
/* INTELLIGENCE GRID                                                          */
/* ========================================================================== */

.keep-intelligence-grid {
    display:
        grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap:
        7px;
}

.keep-intelligence-stat {
    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        8px;

    min-width:
        0;

    padding:
        8px 9px;

    border:
        1px solid
        rgba(125, 70, 160, 0.17);

    border-radius:
        4px;

    background:
        rgba(15, 12, 20, 0.7);
}

.keep-intelligence-label {
    min-width:
        0;

    overflow:
        hidden;

    color:
        #766d7f;

    font-size:
        7px;

    font-weight:
        700;

    letter-spacing:
        0.045em;

    text-overflow:
        ellipsis;

    text-transform:
        uppercase;

    white-space:
        nowrap;
}

.keep-intelligence-stat strong {
    flex:
        0 0 auto;

    color:
        #cfc2d8;

    font-size:
        9px;

    font-weight:
        900;
}


/* ========================================================================== */
/* KEEP SECTIONS                                                              */
/* ========================================================================== */

.keep-section {
    min-width:
        0;

    padding:
        2px;
}

.keep-section > .section-subheader {
    margin-bottom:
        12px;
}


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

.keep-overview-grid {
    display:
        grid;

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

    gap:
        9px;

    min-width:
        0;

    margin-top:
        10px;

    margin-bottom:
        12px;
}

.keep-overview-card {
    min-width:
        0;

    padding:
        11px;

    border:
        1px solid
        rgba(126, 70, 163, 0.22);

    border-radius:
        5px;

    background:
        linear-gradient(
            135deg,
            rgba(31, 22, 40, 0.88),
            rgba(17, 14, 23, 0.9)
        );

    box-shadow:
        inset 0 0 13px rgba(115, 50, 154, 0.025);
}

.keep-overview-card-title {
    color:
        #cdbbda;

    font-size:
        9px;

    font-weight:
        900;

    letter-spacing:
        0.065em;

    text-transform:
        uppercase;
}

.keep-overview-card-text {
    margin-top:
        5px;

    color:
        #7c7285;

    font-size:
        8px;

    line-height:
        1.45;
}

.keep-overview-card-stats {
    margin-top:
        5px;

    color:
        var(--keep-gold-bright);

    font-size:
        10px;

    font-weight:
        800;
}


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

.keep-overview-card-btn,
.keep-panel button.keep-action-btn,
.keep-panel .building-actions button,
.keep-panel .upgrade-entry button,
.keep-panel .castle-building-entry button,
.keep-panel .mage-building-entry button {
    display:
        inline-flex;

    align-items:
        center;

    justify-content:
        center;

    min-height:
        30px;

    padding:
        6px 10px;

    border:
        1px solid
        rgba(142, 78, 184, 0.38);

    border-radius:
        4px;

    color:
        #d9cae4;

    background:
        linear-gradient(
            180deg,
            rgba(63, 37, 78, 0.92),
            rgba(38, 24, 49, 0.94)
        );

    box-shadow:
        inset 0 0 8px rgba(132, 62, 179, 0.05);

    font-family:
        inherit;

    font-size:
        8px;

    font-weight:
        900;

    letter-spacing:
        0.055em;

    text-transform:
        uppercase;

    cursor:
        pointer;

    transition:
        var(--keep-transition);
}

.keep-overview-card-btn:hover,
.keep-panel button.keep-action-btn:hover,
.keep-panel .building-actions button:hover,
.keep-panel .upgrade-entry button:hover,
.keep-panel .castle-building-entry button:hover,
.keep-panel .mage-building-entry button:hover {
    color:
        #ffffff;

    border-color:
        rgba(176, 99, 226, 0.72);

    background:
        linear-gradient(
            180deg,
            rgba(104, 52, 134, 0.98),
            rgba(59, 31, 78, 0.98)
        );

    box-shadow:
        0 0 9px rgba(139, 60, 191, 0.18);
}


/* ========================================================================== */
/* SUBPANELS                                                                  */
/* ========================================================================== */

.keep-subpanel {
    width:
        100%;

    min-width:
        0;

    min-height:
        100%;

    overflow-x:
        hidden;

    overflow-y:
        auto;
}

.keep-subpanel > * {
    max-width:
        100%;
}


/* ========================================================================== */
/* PLACEHOLDER / EMPTY / ERROR STATES                                         */
/* ========================================================================== */

.placeholder,
.keep-empty-state {
    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    min-height:
        130px;

    padding:
        20px;

    border:
        1px dashed
        rgba(131, 74, 168, 0.26);

    border-radius:
        5px;

    color:
        #81768a;

    background:
        rgba(17, 13, 22, 0.54);

    font-size:
        9px;

    line-height:
        1.5;

    text-align:
        center;
}


/* ========================================================================== */
/* BUILDING LIST COMPATIBILITY                                                */
/* ========================================================================== */

.keep-building-entry {
    margin-bottom:
        8px;

    padding:
        10px;

    border:
        1px solid
        rgba(128, 71, 164, 0.22);

    border-radius:
        5px;

    background:
        linear-gradient(
            135deg,
            rgba(29, 21, 37, 0.88),
            rgba(16, 13, 21, 0.92)
        );
}

.keep-building-entry:last-child {
    margin-bottom:
        0;
}

.building-header {
    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        10px;

    margin-bottom:
        5px;
}

.building-name {
    color:
        #dfd1e8;

    font-size:
        10px;

    font-weight:
        900;

    text-transform:
        uppercase;
}

.building-effect {
    color:
        var(--keep-gold);

    font-size:
        8px;

    font-weight:
        800;

    text-align:
        right;
}

.building-desc {
    color:
        #817687;

    font-size:
        8px;

    line-height:
        1.4;
}

.building-meta {
    display:
        flex;

    flex-wrap:
        wrap;

    gap:
        8px 14px;

    margin-top:
        7px;

    padding-top:
        6px;

    border-top:
        1px solid
        rgba(255, 255, 255, 0.045);

    color:
        #776c80;

    font-size:
        8px;
}

.building-actions {
    display:
        flex;

    justify-content:
        flex-end;

    margin-top:
        8px;
}


/* ========================================================================== */
/* FOOTER                                                                     */
/* ========================================================================== */

.keep-command-footer {
    flex:
        0 0 auto;

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        12px;

    min-height:
        31px;

    padding:
        5px 12px;

    border-top:
        1px solid
        rgba(126, 69, 167, 0.25);

    color:
        #6f6578;

    background:
        rgba(10, 8, 14, 0.95);

    font-size:
        8px;
}

.keep-command-footer-left {
    display:
        flex;

    align-items:
        center;

    gap:
        6px;

    min-width:
        0;
}

.keep-command-footer-right {
    flex:
        0 0 auto;
}

.keep-command-footer-right strong {
    margin-left:
        3px;

    color:
        #b8a7c4;
}
/* ========================================================================== */
/* GENERIC OVERVIEW COMPATIBILITY                                             */
/* ========================================================================== */

.keep-stats-grid {
    display:
        grid;

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

    gap:
        8px;

    margin:
        10px 0;
}

.keep-stat-card {
    min-width:
        0;

    padding:
        10px;

    border:
        1px solid
        rgba(126, 70, 163, 0.2);

    border-radius:
        5px;

    background:
        linear-gradient(
            135deg,
            rgba(29, 21, 37, 0.86),
            rgba(16, 13, 21, 0.9)
        );
}

.keep-stat-label {
    color:
        #776d80;

    font-size:
        8px;

    font-weight:
        800;

    letter-spacing:
        0.06em;

    text-transform:
        uppercase;
}

.keep-stat-value {
    margin-top:
        4px;

    color:
        #e3d8eb;

    font-size:
        15px;

    font-weight:
        900;
}

.keep-stat-value.gold {
    color:
        var(--keep-gold-bright);
}

.keep-stat-value.green {
    color:
        #7cc889;
}

.keep-stat-value.red {
    color:
        #df7182;
}

.keep-stat-value.blue {
    color:
        #80a8e0;
}

.keep-stat-value.purple {
    color:
        #c184ec;
}


/* ========================================================================== */
/* RESOURCE DETAIL GRID                                                       */
/* ========================================================================== */

.keep-resource-grid {
    display:
        grid;

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

    gap:
        8px;

    margin:
        10px 0;
}

.keep-resource-card {
    position:
        relative;

    min-width:
        0;

    padding:
        10px;

    overflow:
        hidden;

    border:
        1px solid
        rgba(126, 70, 163, 0.19);

    border-radius:
        5px;

    background:
        rgba(21, 16, 28, 0.82);
}

.keep-resource-card::before {
    content:
        "";

    position:
        absolute;

    top:
        0;

    left:
        0;

    width:
        2px;

    height:
        100%;

    background:
        rgba(161, 91, 209, 0.48);
}

.keep-resource-card-label {
    color:
        #776d80;

    font-size:
        8px;

    font-weight:
        800;

    letter-spacing:
        0.055em;

    text-transform:
        uppercase;
}

.keep-resource-card-value {
    margin-top:
        4px;

    color:
        #e0d4e8;

    font-size:
        14px;

    font-weight:
        900;
}

.keep-resource-card-rate {
    margin-top:
        2px;

    color:
        #6f9f77;

    font-size:
        8px;
}


/* ========================================================================== */
/* POPULATION                                                                 */
/* ========================================================================== */

.keep-population-panel {
    margin:
        10px 0;

    padding:
        12px;

    border:
        1px solid
        rgba(127, 71, 164, 0.21);

    border-radius:
        5px;

    background:
        linear-gradient(
            135deg,
            rgba(30, 21, 38, 0.88),
            rgba(16, 13, 21, 0.91)
        );
}

.keep-population-header {
    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        12px;

    margin-bottom:
        8px;
}

.keep-population-title {
    color:
        #d8c8e2;

    font-size:
        10px;

    font-weight:
        900;

    letter-spacing:
        0.06em;

    text-transform:
        uppercase;
}

.keep-population-total {
    color:
        var(--keep-gold-bright);

    font-size:
        12px;

    font-weight:
        900;
}

.keep-population-bar {
    position:
        relative;

    height:
        8px;

    overflow:
        hidden;

    border:
        1px solid
        rgba(128, 71, 163, 0.22);

    border-radius:
        5px;

    background:
        rgba(0, 0, 0, 0.45);
}

.keep-population-fill {
    width:
        0%;

    height:
        100%;

    background:
        linear-gradient(
            90deg,
            #5d317c,
            #a760d2
        );

    transition:
        width 250ms ease;
}

.keep-population-details {
    display:
        grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap:
        6px;

    margin-top:
        8px;
}

.keep-population-detail {
    padding:
        6px;

    border:
        1px solid
        rgba(255, 255, 255, 0.045);

    border-radius:
        4px;

    color:
        #786e80;

    background:
        rgba(0, 0, 0, 0.16);

    font-size:
        7px;

    text-align:
        center;

    text-transform:
        uppercase;
}

.keep-population-detail strong {
    display:
        block;

    margin-top:
        2px;

    color:
        #cfc0d9;

    font-size:
        9px;
}


/* ========================================================================== */
/* LAND MANAGEMENT                                                            */
/* ========================================================================== */

.keep-land-management {
    display: flex;
    flex-direction: column;
    gap: 14px;
}


/* ========================================================================== */
/* LAND HERO                                                                  */
/* ========================================================================== */

.keep-land-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;

    padding: 16px;

    border: 1px solid rgba(217, 180, 93, 0.2);
    border-radius: 8px;

    background:
        radial-gradient(
            circle at 0% 0%,
            rgba(122, 72, 156, 0.14),
            transparent 42%
        ),
        linear-gradient(
            135deg,
            rgba(25, 18, 31, 0.96),
            rgba(11, 9, 14, 0.96)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.025),
        0 8px 24px rgba(0, 0, 0, 0.24);
}

.keep-land-hero-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.keep-land-hero-status {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    gap: 7px;

    padding: 7px 10px;

    border: 1px solid rgba(217, 180, 93, 0.18);
    border-radius: 5px;

    background: rgba(0, 0, 0, 0.28);

    color: var(--keep-gold);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;

    white-space: nowrap;
}


/* ========================================================================== */
/* LAND SUMMARY                                                               */
/* ========================================================================== */

.keep-land-summary-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 10px;
}

.keep-land-summary-card {
    position: relative;

    min-width: 0;

    padding: 13px 14px;

    overflow: hidden;

    border: 1px solid rgba(122, 72, 156, 0.2);
    border-radius: 7px;

    background:
        linear-gradient(
            145deg,
            rgba(31, 23, 39, 0.92),
            rgba(13, 11, 17, 0.96)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.keep-land-summary-card::before {
    content: "";

    position: absolute;

    top: 0;
    left: 0;

    width: 100%;
    height: 2px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(164, 92, 206, 0.7),
            transparent
        );
}

.keep-land-summary-card-free {
    border-color: rgba(217, 180, 93, 0.3);

    background:
        linear-gradient(
            145deg,
            rgba(47, 36, 22, 0.76),
            rgba(14, 11, 12, 0.96)
        );
}

.keep-land-summary-card-free::before {
    background:
        linear-gradient(
            90deg,
            transparent,
            var(--keep-gold),
            transparent
        );
}

.keep-land-summary-label {
    display: block;

    margin-bottom: 6px;

    color: #8f8399;

    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.keep-land-summary-value {
    display: block;

    overflow: hidden;

    color: #eee5f4;

    font-size: 21px;
    font-weight: 900;
    line-height: 1.05;

    text-overflow: ellipsis;
}

.keep-land-summary-card-free .keep-land-summary-value {
    color: var(--keep-gold-bright);
}

.keep-land-summary-unit {
    display: block;

    margin-top: 5px;

    color: #706777;

    font-size: 8px;
}


/* ========================================================================== */
/* DEVELOPMENT METER                                                          */
/* ========================================================================== */

.keep-land-development-meter {
    padding: 11px 13px;

    border: 1px solid rgba(122, 72, 156, 0.18);
    border-radius: 7px;

    background: rgba(12, 10, 15, 0.82);
}

.keep-land-development-meter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-bottom: 7px;

    color: #95889f;

    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.keep-land-development-meter-header strong {
    color: #d7cadf;

    font-size: 9px;
}

.keep-land-development-track {
    position: relative;

    width: 100%;
    height: 7px;

    overflow: hidden;

    border: 1px solid rgba(122, 72, 156, 0.22);
    border-radius: 8px;

    background: rgba(0, 0, 0, 0.48);
}

.keep-land-development-fill {
    width: 0%;
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            #552675,
            #8f49b7,
            #d9b45d
        );

    box-shadow:
        0 0 8px rgba(152, 78, 202, 0.28);

    transition: width 260ms ease;
}


/* ========================================================================== */
/* LAND MESSAGE                                                               */
/* ========================================================================== */

.keep-land-message {
    display: none;

    padding: 9px 12px;

    border: 1px solid transparent;
    border-radius: 6px;

    font-size: 9px;
    font-weight: 700;
    line-height: 1.4;
}

.keep-land-message-visible {
    display: block;
}

.keep-land-message-success {
    border-color: rgba(94, 168, 110, 0.3);

    background: rgba(45, 104, 58, 0.12);

    color: #9fd6a9;
}

.keep-land-message-error {
    border-color: rgba(190, 72, 72, 0.38);

    background: rgba(125, 35, 35, 0.14);

    color: #e2a1a1;
}


/* ========================================================================== */
/* LAND DEVELOPMENT HEADER                                                    */
/* ========================================================================== */

.keep-land-development-header {
    margin-bottom: -4px;
}

.keep-land-free-badge {
    flex: 0 0 auto;

    display: flex;
    align-items: baseline;
    gap: 5px;

    padding: 6px 9px;

    border: 1px solid rgba(217, 180, 93, 0.22);
    border-radius: 5px;

    background: rgba(217, 180, 93, 0.06);

    color: #918370;

    font-size: 8px;
    text-transform: uppercase;
}

.keep-land-free-badge strong {
    color: var(--keep-gold-bright);

    font-size: 12px;
    font-weight: 900;
}


/* ========================================================================== */
/* ALLOCATION GRID                                                            */
/* ========================================================================== */

.keep-land-allocation-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 10px;
}


/* ========================================================================== */
/* ALLOCATION CARD                                                            */
/* ========================================================================== */

.keep-land-allocation-card {
    min-width: 0;

    padding: 13px;

    border: 1px solid rgba(122, 72, 156, 0.2);
    border-radius: 7px;

    background:
        linear-gradient(
            145deg,
            rgba(27, 21, 34, 0.94),
            rgba(12, 10, 15, 0.97)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.018);

    transition:
        border-color 150ms ease,
        transform 150ms ease,
        box-shadow 150ms ease;
}

.keep-land-allocation-card:hover {
    border-color: rgba(164, 92, 206, 0.38);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.025),
        0 6px 18px rgba(0, 0, 0, 0.2);
}

.keep-land-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.keep-land-card-heading {
    min-width: 0;

    display: flex;
    align-items: flex-start;
    gap: 10px;

    flex: 1 1 auto;
}

.keep-land-category-code {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 38px;
    height: 32px;

    padding: 0 6px;

    border: 1px solid rgba(164, 92, 206, 0.28);
    border-radius: 5px;

    background:
        linear-gradient(
            145deg,
            rgba(104, 49, 139, 0.22),
            rgba(42, 24, 53, 0.32)
        );

    color: #c79bdd;

    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.045em;
}

.keep-land-category-title {
    margin-bottom: 4px;

    color: #e0d5e7;

    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.025em;
}

.keep-land-category-description {
    max-width: 420px;

    color: #756b7c;

    font-size: 8px;
    line-height: 1.45;
}

.keep-land-acre-total {
    flex: 0 0 auto;

    display: flex;
    flex-direction: column;
    align-items: flex-end;

    text-align: right;
}

.keep-land-acre-total strong {
    color: var(--keep-gold-bright);

    font-size: 16px;
    font-weight: 900;
    line-height: 1;
}

.keep-land-acre-total span {
    margin-top: 4px;

    color: #756b7c;

    font-size: 7px;
    text-transform: uppercase;
}


/* ========================================================================== */
/* ALLOCATION PROGRESS                                                        */
/* ========================================================================== */

.keep-land-progress {
    width: 100%;
    height: 5px;

    margin-top: 11px;

    overflow: hidden;

    border: 1px solid rgba(122, 72, 156, 0.18);
    border-radius: 6px;

    background: rgba(0, 0, 0, 0.42);
}

.keep-land-progress-fill {
    width: 0%;
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            #5b287f,
            #a45cce
        );

    box-shadow:
        0 0 5px rgba(152, 78, 202, 0.22);

    transition: width 240ms ease;
}

.keep-land-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;

    margin-top: 5px;

    color: #706777;

    font-size: 7px;
    text-transform: uppercase;
}

.keep-land-card-meta strong {
    color: #b6a8bf;

    font-size: 8px;
}


/* ========================================================================== */
/* LAND CONTROLS                                                              */
/* ========================================================================== */

.keep-land-card-controls {
    display: grid;

    grid-template-columns:
        minmax(90px, 0.8fr)
        minmax(180px, 1.2fr);

    align-items: end;

    gap: 9px;

    margin-top: 11px;
}

.keep-land-input-group,
.keep-land-select-group {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 5px;
}

.keep-land-input-group > span,
.keep-land-select-group > span {
    color: #8f8399;

    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.keep-land-input,
.keep-land-select {
    width: 100%;
    min-width: 0;
    height: 31px;

    padding: 0 9px;

    border: 1px solid rgba(122, 72, 156, 0.28);
    border-radius: 4px;

    outline: none;

    background: rgba(5, 4, 7, 0.72);

    color: #ddd1e6;

    font-family: inherit;
    font-size: 9px;
    font-weight: 700;

    transition:
        border-color 150ms ease,
        box-shadow 150ms ease,
        background 150ms ease;
}

.keep-land-input:focus,
.keep-land-select:focus {
    border-color: rgba(217, 180, 93, 0.52);

    background: rgba(10, 8, 12, 0.92);

    box-shadow:
        0 0 0 2px rgba(217, 180, 93, 0.06);
}

.keep-land-input::placeholder {
    color: #554d5a;
}

.keep-land-select option {
    background: #151119;

    color: #ddd1e6;
}

.keep-land-card-actions {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 6px;
}


/* ========================================================================== */
/* LAND BUTTONS                                                               */
/* ========================================================================== */

.keep-land-allocate-button,
.keep-land-reclaim-button,
.keep-land-reallocate-button {
    min-height: 31px;

    margin: 0;

    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.keep-land-allocate-button {
    border-color: rgba(217, 180, 93, 0.35);

    background:
        linear-gradient(
            180deg,
            rgba(103, 78, 31, 0.46),
            rgba(49, 35, 18, 0.5)
        );

    color: var(--keep-gold-bright);
}

.keep-land-allocate-button:hover:not(:disabled) {
    border-color: rgba(217, 180, 93, 0.58);

    background:
        linear-gradient(
            180deg,
            rgba(123, 93, 37, 0.56),
            rgba(58, 41, 20, 0.58)
        );
}

.keep-land-reclaim-button {
    border-color: rgba(164, 92, 206, 0.28);

    background:
        linear-gradient(
            180deg,
            rgba(80, 42, 103, 0.42),
            rgba(38, 24, 46, 0.5)
        );

    color: #c7a7d8;
}

.keep-land-reclaim-button:hover:not(:disabled) {
    border-color: rgba(164, 92, 206, 0.48);
}

.keep-land-allocate-button:disabled,
.keep-land-reclaim-button:disabled,
.keep-land-reallocate-button:disabled {
    cursor: not-allowed;

    opacity: 0.38;

    filter: grayscale(0.35);
}


/* ========================================================================== */
/* REALLOCATION                                                               */
/* ========================================================================== */

.keep-land-reallocation-panel {
    margin-top: 2px;
}

.keep-land-reallocation-controls {
    display: grid;

    grid-template-columns:
        minmax(140px, 1fr)
        28px
        minmax(140px, 1fr)
        minmax(90px, 0.55fr)
        minmax(100px, auto);

    align-items: end;

    gap: 9px;

    margin-top: 12px;
}

.keep-land-reallocation-arrow {
    display: flex;
    align-items: center;
    justify-content: center;

    height: 31px;

    color: var(--keep-gold);

    font-size: 18px;
    font-weight: 900;
}

.keep-land-reallocation-amount {
    min-width: 90px;
}

.keep-land-reallocate-button {
    border-color: rgba(217, 180, 93, 0.34);

    background:
        linear-gradient(
            180deg,
            rgba(91, 55, 111, 0.5),
            rgba(46, 28, 56, 0.58)
        );

    color: var(--keep-gold-bright);
}

.keep-land-reallocate-button:hover:not(:disabled) {
    border-color: rgba(217, 180, 93, 0.55);

    box-shadow:
        0 0 9px rgba(217, 180, 93, 0.08);
}


/* ========================================================================== */
/* LAND ERROR PANEL                                                           */
/* ========================================================================== */

.keep-land-error-panel {
    margin-top: 12px;

    border-color: rgba(190, 72, 72, 0.26);
}

.keep-land-error-actions {
    margin-top: 12px;
}


/* ========================================================================== */
/* LAND RESPONSIVE — TABLET                                                   */
/* ========================================================================== */

@media (max-width: 900px) {

    .keep-land-summary-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .keep-land-allocation-grid {
        grid-template-columns:
            1fr;
    }

    .keep-land-reallocation-controls {
        grid-template-columns:
            1fr 24px 1fr;
    }

    .keep-land-reallocation-amount {
        grid-column:
            1 / 3;
    }

    .keep-land-reallocate-button {
        grid-column:
            3;
    }
}


/* ========================================================================== */
/* LAND RESPONSIVE — MOBILE                                                   */
/* ========================================================================== */

@media (max-width: 620px) {

    .keep-land-management {
        gap: 10px;
    }

    .keep-land-hero {
        flex-direction: column;

        gap: 10px;

        padding: 12px;
    }

    .keep-land-hero-status {
        align-self: flex-start;
    }

    .keep-land-summary-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 7px;
    }

    .keep-land-summary-card {
        padding: 10px;
    }

    .keep-land-summary-value {
        font-size: 17px;
    }

    .keep-land-card-header {
        gap: 8px;
    }

    .keep-land-category-description {
        font-size: 7px;
    }

    .keep-land-card-controls {
        grid-template-columns:
            1fr;
    }

    .keep-land-reallocation-controls {
        grid-template-columns:
            1fr;
    }

    .keep-land-reallocation-arrow {
        height: auto;

        transform: rotate(90deg);
    }

    .keep-land-reallocation-amount,
    .keep-land-reallocate-button {
        grid-column:
            auto;
    }
}


/* ========================================================================== */
/* LAND RESPONSIVE — SMALL PHONE                                              */
/* ========================================================================== */

@media (max-width: 420px) {

    .keep-land-summary-grid {
        grid-template-columns:
            1fr;
    }

    .keep-land-card-heading {
        gap: 7px;
    }

    .keep-land-category-code {
        min-width: 34px;
        height: 29px;
    }

    .keep-land-acre-total strong {
        font-size: 14px;
    }

    .keep-land-card-actions {
        grid-template-columns:
            1fr;
    }

    .keep-land-development-meter-header {
        align-items: flex-start;

        flex-direction: column;

        gap: 3px;
    }

    .keep-land-free-badge {
        margin-top: 7px;
    }
}

/* ========================================================================== */
/* ECONOMY PANEL                                                              */
/* ========================================================================== */

.keep-economy-grid {
    display:
        grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap:
        8px;

    margin:
        10px 0;
}

.keep-economy-card {
    padding:
        10px;

    border:
        1px solid
        rgba(128, 72, 164, 0.2);

    border-radius:
        5px;

    background:
        rgba(20, 15, 26, 0.82);
}

.keep-economy-card-title {
    color:
        #8b8093;

    font-size:
        8px;

    font-weight:
        800;

    letter-spacing:
        0.05em;

    text-transform:
        uppercase;
}

.keep-economy-card-value {
    margin-top:
        4px;

    color:
        #d9cde2;

    font-size:
        14px;

    font-weight:
        900;
}

.keep-economy-card-sub {
    margin-top:
        3px;

    color:
        #6e6576;

    font-size:
        7px;
}


/* ========================================================================== */
/* DEFENSE / OFFENSE                                                          */
/* ========================================================================== */

.keep-military-grid {
    display:
        grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap:
        9px;

    margin:
        10px 0;
}

.keep-military-card {
    padding:
        12px;

    border:
        1px solid
        rgba(127, 71, 163, 0.21);

    border-radius:
        5px;

    background:
        linear-gradient(
            135deg,
            rgba(29, 21, 37, 0.9),
            rgba(16, 13, 21, 0.92)
        );
}

.keep-military-card.offense {
    border-color:
        rgba(160, 57, 73, 0.3);
}

.keep-military-card.defense {
    border-color:
        rgba(72, 114, 166, 0.3);
}

.keep-military-title {
    color:
        #bfaed0;

    font-size:
        9px;

    font-weight:
        900;

    letter-spacing:
        0.065em;

    text-transform:
        uppercase;
}

.keep-military-value {
    margin-top:
        5px;

    color:
        #e3d8eb;

    font-size:
        19px;

    font-weight:
        900;
}

.keep-military-card.offense .keep-military-value {
    color:
        #dd7282;
}

.keep-military-card.defense .keep-military-value {
    color:
        #83a9dd;
}

.keep-military-breakdown {
    margin-top:
        8px;

    padding-top:
        7px;

    border-top:
        1px solid
        rgba(255, 255, 255, 0.045);
}

.keep-military-breakdown-row {
    display:
        flex;

    justify-content:
        space-between;

    gap:
        8px;

    padding:
        3px 0;

    color:
        #756b7d;

    font-size:
        8px;
}

.keep-military-breakdown-row strong {
    color:
        #bcaec6;
}


/* ========================================================================== */
/* BUILDING / CONSTRUCTION QUEUE                                              */
/* ========================================================================== */

.keep-construction-queue {
    margin:
        10px 0;

    padding:
        10px;

    border:
        1px solid
        rgba(128, 72, 164, 0.2);

    border-radius:
        5px;

    background:
        rgba(17, 13, 22, 0.8);
}

.keep-construction-queue-title {
    margin-bottom:
        8px;

    color:
        #c5b2d3;

    font-size:
        9px;

    font-weight:
        900;

    letter-spacing:
        0.065em;

    text-transform:
        uppercase;
}

.keep-construction-item {
    display:
        grid;

    grid-template-columns:
        minmax(0, 1fr) auto;

    gap:
        10px;

    padding:
        7px 0;

    border-top:
        1px solid
        rgba(255, 255, 255, 0.04);
}

.keep-construction-item:first-of-type {
    border-top:
        0;
}

.keep-construction-name {
    color:
        #bfb0ca;

    font-size:
        8px;

    font-weight:
        800;
}

.keep-construction-time {
    color:
        var(--keep-gold);

    font-size:
        8px;

    font-weight:
        800;
}


/* ========================================================================== */
/* STRUCTURE CARDS                                                            */
/* ========================================================================== */

.keep-structure-grid {
    display:
        grid;

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

    gap:
        9px;

    margin-top:
        10px;
}

.keep-structure-card {
    position:
        relative;

    min-width:
        0;

    padding:
        12px;

    overflow:
        hidden;

    border:
        1px solid
        rgba(126, 70, 163, 0.22);

    border-radius:
        5px;

    background:
        linear-gradient(
            135deg,
            rgba(31, 22, 40, 0.9),
            rgba(16, 13, 22, 0.94)
        );
}

.keep-structure-card:hover {
    border-color:
        rgba(158, 86, 205, 0.48);
}

.keep-structure-card-title {
    color:
        #ddcfe7;

    font-size:
        10px;

    font-weight:
        900;

    letter-spacing:
        0.05em;

    text-transform:
        uppercase;
}

.keep-structure-card-level {
    margin-top:
        2px;

    color:
        var(--keep-gold);

    font-size:
        8px;

    font-weight:
        800;
}

.keep-structure-card-desc {
    margin-top:
        6px;

    color:
        #7e7387;

    font-size:
        8px;

    line-height:
        1.45;
}

.keep-structure-bonuses {
    margin-top:
        8px;

    padding-top:
        7px;

    border-top:
        1px solid
        rgba(255, 255, 255, 0.045);
}

.keep-structure-bonus-row {
    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        8px;

    padding:
        3px 0;

    color:
        #766c7e;

    font-size:
        8px;
}

.keep-structure-bonus-row strong {
    color:
        #bfaec9;

    font-weight:
        900;
}


/* ========================================================================== */
/* UPGRADE COSTS                                                              */
/* ========================================================================== */

.keep-cost-grid {
    display:
        flex;

    flex-wrap:
        wrap;

    gap:
        5px;

    margin-top:
        8px;
}

.keep-cost-item {
    display:
        inline-flex;

    align-items:
        center;

    gap:
        4px;

    padding:
        4px 6px;

    border:
        1px solid
        rgba(255, 255, 255, 0.055);

    border-radius:
        3px;

    color:
        #82778b;

    background:
        rgba(0, 0, 0, 0.2);

    font-size:
        7px;

    text-transform:
        uppercase;
}

.keep-cost-item strong {
    color:
        #c9bacf;

    font-size:
        8px;
}


/* ========================================================================== */
/* UPGRADES                                                                   */
/* ========================================================================== */

.keep-upgrade-grid {
    display:
        grid;

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

    gap:
        9px;

    margin-top:
        10px;
}

.upgrade-entry {
    position:
        relative;
}

.upgrade-entry::before {
    content:
        "";

    position:
        absolute;

    top:
        0;

    left:
        0;

    width:
        2px;

    height:
        100%;

    background:
        rgba(164, 91, 210, 0.52);
}


/* ========================================================================== */
/* CASTLE                                                                     */
/* ========================================================================== */

.castle-building-entry {
    border-color:
        rgba(217, 180, 93, 0.24);

    background:
        linear-gradient(
            135deg,
            rgba(40, 30, 24, 0.9),
            rgba(20, 16, 21, 0.94)
        );
}

.castle-building-entry .building-name {
    color:
        #e5d3ad;
}

.castle-building-entry .building-effect {
    color:
        var(--keep-gold-bright);
}


/* ========================================================================== */
/* MAGE TOWER                                                                 */
/* ========================================================================== */

.mage-building-entry {
    border-color:
        rgba(127, 75, 193, 0.3);

    background:
        linear-gradient(
            135deg,
            rgba(32, 22, 48, 0.92),
            rgba(17, 13, 25, 0.95)
        );
}

.mage-building-entry .building-name {
    color:
        #d0b8ea;
}

.mage-building-entry .building-effect {
    color:
        #bb83e5;
}


/* ========================================================================== */
/* WALLS                                                                      */
/* ========================================================================== */

.keep-wall-panel {
    padding:
        12px;

    border:
        1px solid
        rgba(125, 129, 140, 0.24);

    border-radius:
        5px;

    background:
        linear-gradient(
            135deg,
            rgba(29, 29, 34, 0.92),
            rgba(16, 14, 20, 0.94)
        );
}

.keep-wall-integrity {
    margin-top:
        10px;
}

.keep-wall-track {
    position:
        relative;

    height:
        9px;

    overflow:
        hidden;

    border:
        1px solid
        rgba(154, 154, 164, 0.2);

    border-radius:
        5px;

    background:
        rgba(0, 0, 0, 0.45);
}

.keep-wall-fill {
    width:
        0%;

    height:
        100%;

    background:
        linear-gradient(
            90deg,
            #62656c,
            #b0b4bd
        );

    transition:
        width 250ms ease;
}


/* ========================================================================== */
/* TOWERS                                                                     */
/* ========================================================================== */

.keep-tower-grid {
    display:
        grid;

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

    gap:
        8px;

    margin-top:
        10px;
}

.keep-tower-card {
    padding:
        10px;

    border:
        1px solid
        rgba(103, 123, 161, 0.24);

    border-radius:
        5px;

    background:
        linear-gradient(
            135deg,
            rgba(24, 29, 39, 0.9),
            rgba(14, 15, 21, 0.94)
        );
}

.keep-tower-card-title {
    color:
        #b8c8df;

    font-size:
        9px;

    font-weight:
        900;

    text-transform:
        uppercase;
}

.keep-tower-card-value {
    margin-top:
        4px;

    color:
        #83a7d5;

    font-size:
        13px;

    font-weight:
        900;
}


/* ========================================================================== */
/* JAIL                                                                       */
/* ========================================================================== */

.keep-jail-panel {
    padding:
        12px;

    border:
        1px solid
        rgba(138, 63, 76, 0.3);

    border-radius:
        5px;

    background:
        linear-gradient(
            135deg,
            rgba(43, 22, 27, 0.92),
            rgba(19, 14, 18, 0.95)
        );
}

.keep-jail-header {
    color:
        #d28a95;

    font-size:
        10px;

    font-weight:
        900;

    letter-spacing:
        0.065em;

    text-transform:
        uppercase;
}

.keep-prisoner-list {
    margin-top:
        10px;
}

.keep-prisoner-row {
    display:
        grid;

    grid-template-columns:
        minmax(0, 1fr) auto;

    gap:
        10px;

    padding:
        8px;

    border-top:
        1px solid
        rgba(255, 255, 255, 0.045);
}

.keep-prisoner-name {
    color:
        #cbb7bb;

    font-size:
        8px;

    font-weight:
        800;
}

.keep-prisoner-status {
    color:
        #b95e6d;

    font-size:
        8px;

    font-weight:
        800;
}


/* ========================================================================== */
/* VAULT                                                                      */
/* ========================================================================== */

.keep-vault-panel {
    padding:
        12px;

    border:
        1px solid
        rgba(217, 180, 93, 0.3);

    border-radius:
        5px;

    background:
        linear-gradient(
            135deg,
            rgba(48, 37, 23, 0.92),
            rgba(22, 17, 19, 0.95)
        );
}

.keep-vault-balance {
    margin-top:
        5px;

    color:
        var(--keep-gold-bright);

    font-size:
        22px;

    font-weight:
        900;

    text-shadow:
        0 0 10px rgba(217, 180, 93, 0.13);
}

.keep-vault-capacity {
    margin-top:
        3px;

    color:
        #88785c;

    font-size:
        8px;
}


/* ========================================================================== */
/* THRONE / ROYAL COMMAND                                                     */
/* ========================================================================== */

.keep-throne-panel {
    position:
        relative;

    padding:
        14px;

    overflow:
        hidden;

    border:
        1px solid
        rgba(217, 180, 93, 0.38);

    border-radius:
        6px;

    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(217, 180, 93, 0.09),
            transparent 45%
        ),
        linear-gradient(
            135deg,
            rgba(48, 35, 24, 0.94),
            rgba(22, 16, 23, 0.97)
        );

    box-shadow:
        inset 0 0 25px rgba(217, 180, 93, 0.04);
}

.keep-throne-panel::before {
    content:
        "?";

    position:
        absolute;

    top:
        7px;

    right:
        14px;

    color:
        rgba(240, 213, 139, 0.09);

    font-size:
        72px;

    line-height:
        1;

    pointer-events:
        none;
}

.keep-throne-title {
    position:
        relative;

    z-index:
        1;

    color:
        #f0dca7;

    font-size:
        14px;

    font-weight:
        900;

    letter-spacing:
        0.08em;

    text-transform:
        uppercase;
}

.keep-throne-subtitle {
    position:
        relative;

    z-index:
        1;

    max-width:
        650px;

    margin-top:
        4px;

    color:
        #9b8a72;

    font-size:
        8px;

    line-height:
        1.5;
}

.keep-throne-actions {
    position:
        relative;

    z-index:
        1;

    display:
        flex;

    flex-wrap:
        wrap;

    gap:
        7px;

    margin-top:
        12px;
}

.keep-throne-action {
    min-height:
        31px;

    padding:
        6px 11px;

    border:
        1px solid
        rgba(217, 180, 93, 0.34);

    border-radius:
        4px;

    color:
        #e7d19d;

    background:
        linear-gradient(
            180deg,
            rgba(76, 55, 32, 0.92),
            rgba(43, 30, 26, 0.95)
        );

    font-family:
        inherit;

    font-size:
        8px;

    font-weight:
        900;

    letter-spacing:
        0.055em;

    text-transform:
        uppercase;

    cursor:
        pointer;

    transition:
        var(--keep-transition);
}

.keep-throne-action:hover {
    color:
        #fff0c6;

    border-color:
        rgba(240, 213, 139, 0.7);

    background:
        linear-gradient(
            180deg,
            rgba(111, 78, 40, 0.98),
            rgba(58, 39, 30, 0.98)
        );

    box-shadow:
        0 0 11px rgba(217, 180, 93, 0.16);
}


/* ========================================================================== */
/* POSITIVE / NEGATIVE / WARNING TEXT                                         */
/* ========================================================================== */

.keep-positive {
    color:
        #78bd83 !important;
}

.keep-negative {
    color:
        #d66b7b !important;
}

.keep-warning {
    color:
        #d6ad62 !important;
}

.keep-magic {
    color:
        #b97de4 !important;
}

.keep-defense {
    color:
        #7ea3d3 !important;
}


/* ========================================================================== */
/* BADGES                                                                     */
/* ========================================================================== */

.keep-badge {
    display:
        inline-flex;

    align-items:
        center;

    justify-content:
        center;

    padding:
        3px 6px;

    border:
        1px solid
        rgba(132, 74, 169, 0.24);

    border-radius:
        10px;

    color:
        #a798b2;

    background:
        rgba(24, 18, 30, 0.8);

    font-size:
        7px;

    font-weight:
        800;

    letter-spacing:
        0.04em;

    text-transform:
        uppercase;
}

.keep-badge-gold {
    color:
        #ddc27e;

    border-color:
        rgba(217, 180, 93, 0.3);

    background:
        rgba(67, 50, 27, 0.42);
}

.keep-badge-danger {
    color:
        #d37887;

    border-color:
        rgba(175, 60, 79, 0.3);

    background:
        rgba(66, 27, 34, 0.42);
}

.keep-badge-success {
    color:
        #82bc8b;

    border-color:
        rgba(72, 142, 84, 0.3);

    background:
        rgba(27, 59, 33, 0.42);
}


/* ========================================================================== */
/* PROGRESS BARS                                                              */
/* ========================================================================== */

.keep-progress {
    width:
        100%;

    height:
        6px;

    overflow:
        hidden;

    border:
        1px solid
        rgba(128, 72, 164, 0.18);

    border-radius:
        5px;

    background:
        rgba(0, 0, 0, 0.45);
}

.keep-progress-fill {
    width:
        0%;

    height:
        100%;

    background:
        linear-gradient(
            90deg,
            #63318a,
            #aa61d5
        );

    transition:
        width 250ms ease;
}

.keep-progress-fill.gold {
    background:
        linear-gradient(
            90deg,
            #89682d,
            #d9b45d
        );
}

.keep-progress-fill.red {
    background:
        linear-gradient(
            90deg,
            #762d3a,
            #c95668
        );
}

.keep-progress-fill.green {
    background:
        linear-gradient(
            90deg,
            #356b40,
            #69af76
        );
}


/* ========================================================================== */
/* TABLES                                                                     */
/* ========================================================================== */

.keep-table-wrap {
    width:
        100%;

    overflow-x:
        auto;

    border:
        1px solid
        rgba(126, 70, 163, 0.18);

    border-radius:
        5px;
}

.keep-table {
    width:
        100%;

    border-collapse:
        collapse;

    color:
        #a99db2;

    background:
        rgba(14, 11, 19, 0.76);

    font-size:
        8px;
}

.keep-table th {
    padding:
        7px 8px;

    border-bottom:
        1px solid
        rgba(139, 79, 181, 0.2);

    color:
        #bfa9cf;

    background:
        rgba(42, 27, 52, 0.72);

    font-size:
        7px;

    font-weight:
        900;

    letter-spacing:
        0.06em;

    text-align:
        left;

    text-transform:
        uppercase;
}

.keep-table td {
    padding:
        7px 8px;

    border-bottom:
        1px solid
        rgba(255, 255, 255, 0.035);
}

.keep-table tr:last-child td {
    border-bottom:
        0;
}

.keep-table tbody tr:hover {
    background:
        rgba(82, 43, 103, 0.18);
}


/* ========================================================================== */
/* TOOLTIPS                                                                   */
/* ========================================================================== */

.keep-tooltip {
    position:
        relative;
}

.keep-tooltip[data-tooltip]::after {
    content:
        attr(data-tooltip);

    position:
        absolute;

    left:
        50%;

    bottom:
        calc(100% + 7px);

    z-index:
        500;

    width:
        max-content;

    max-width:
        220px;

    padding:
        6px 8px;

    opacity:
        0;

    visibility:
        hidden;

    transform:
        translateX(-50%) translateY(3px);

    border:
        1px solid
        rgba(147, 82, 190, 0.35);

    border-radius:
        4px;

    color:
        #cdbfd6;

    background:
        rgba(10, 8, 14, 0.98);

    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.55);

    font-size:
        7px;

    line-height:
        1.4;

    pointer-events:
        none;

    transition:
        120ms ease;
}

.keep-tooltip[data-tooltip]:hover::after {
    opacity:
        1;

    visibility:
        visible;

    transform:
        translateX(-50%) translateY(0);
}


/* ========================================================================== */
/* DISABLED STATES                                                            */
/* ========================================================================== */

.keep-panel button:disabled,
.keep-panel .disabled,
.keep-panel [aria-disabled="true"] {
    opacity:
        0.4;

    cursor:
        not-allowed !important;

    filter:
        grayscale(0.45);

    pointer-events:
        none;
}


/* ========================================================================== */
/* FOCUS                                                                      */
/* ========================================================================== */

.keep-tab:focus-visible,
.keep-facility-card:focus-visible,
.keep-overview-card-btn:focus-visible,
.keep-panel button:focus-visible {
    outline:
        2px solid
        rgba(177, 99, 226, 0.78);

    outline-offset:
        2px;
}

.keep-tab-throne:focus-visible,
.keep-throne-card:focus-visible,
.keep-throne-action:focus-visible {
    outline:
        2px solid
        rgba(240, 213, 139, 0.9);

    outline-offset:
        2px;

    box-shadow:
        0 0 16px rgba(217, 180, 93, 0.34);
}


/* ========================================================================== */
/* LOADING                                                                    */
/* ========================================================================== */

.keep-loading {
    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    gap:
        8px;

    min-height:
        130px;

    color:
        #8e8198;

    font-size:
        8px;

    font-weight:
        800;

    letter-spacing:
        0.055em;

    text-transform:
        uppercase;
}

.keep-loading-spinner {
    width:
        17px;

    height:
        17px;

    border:
        2px solid
        rgba(158, 90, 205, 0.18);

    border-top-color:
        rgba(181, 106, 230, 0.8);

    border-radius:
        50%;

    animation:
        keep-spin 0.75s linear infinite;
}

@keyframes keep-spin {
    to {
        transform:
            rotate(360deg);
    }
}


/* ========================================================================== */
/* SUBTLE PANEL ENTRANCE                                                      */
/* ========================================================================== */

.keep-dynamic-container > .keep-subpanel,
.keep-dynamic-container > .keep-section,
.keep-dynamic-container > .keep-overview-shell {
    animation:
        keep-panel-enter 130ms ease-out;
}

@keyframes keep-panel-enter {
    from {
        opacity:
            0;

        transform:
            translateY(2px);
    }

    to {
        opacity:
            1;

        transform:
            translateY(0);
    }
}


/* ========================================================================== */
/* DESKTOP — MEDIUM                                                           */
/* ========================================================================== */

@media (max-width: 1200px) {

    .keep-command-header-right {
        min-width:
            300px;
    }

    .keep-resource-strip {
        grid-template-columns:
            repeat(3, minmax(100px, 1fr));
    }

    .keep-resource-item:nth-child(3) {
        border-right:
            0;
    }

    .keep-resource-item:nth-child(-n + 3) {
        border-bottom:
            1px solid
            rgba(255, 255, 255, 0.04);
    }

    .keep-facility-grid,
    .keep-facility-grid-small {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .keep-intelligence-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


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

@media (max-width: 950px) {

    .keep-command-header {
        align-items:
            flex-start;

        flex-direction:
            column;

        gap:
            10px;

        min-height:
            0;

        padding:
            14px 55px 12px 14px;
    }

    .keep-command-header-right {
        width:
            100%;

        min-width:
            0;

        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .keep-kingdom-status-bar {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .keep-kingdom-status-block:nth-child(3) {
        border-right:
            0;
    }

    .keep-kingdom-status-block:nth-child(-n + 3) {
        border-bottom:
            1px solid
            rgba(255, 255, 255, 0.04);
    }

    .keep-command-body {
        grid-template-columns:
            180px minmax(0, 1fr);
    }

    .keep-land-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .keep-economy-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


/* ========================================================================== */
/* MOBILE / SMALL TABLET                                                      */
/* ========================================================================== */

@media (max-width: 700px) {

    .keep-panel {
        font-size:
            12px;
    }

    .keep-panel .panel-close-btn,
    .keep-close-btn {
        top:
            8px;

        right:
            8px;

        width:
            32px;

        height:
            32px;

        font-size:
            24px;
    }

    .keep-command-header {
        padding:
            12px 46px 10px 11px;
    }

    .keep-command-eyebrow {
        font-size:
            8px;
    }

    .keep-command-title {
        font-size:
            19px;
    }

    .keep-command-subtitle {
        font-size:
            9px;
    }

    .keep-command-header-right {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap:
            4px;
    }

    .keep-header-status {
        padding:
            6px 4px;
    }

    .keep-header-status-label {
        font-size:
            7px;
    }

    .keep-header-status-value {
        font-size:
            12px;
    }

    .keep-resource-strip {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .keep-resource-item {
        padding:
            6px 7px;
    }

    .keep-resource-item:nth-child(odd) {
        border-right:
            1px solid
            rgba(255, 255, 255, 0.045);
    }

    .keep-resource-item:nth-child(even) {
        border-right:
            0;
    }

    .keep-resource-item:nth-child(-n + 4) {
        border-bottom:
            1px solid
            rgba(255, 255, 255, 0.04);
    }

    .keep-resource-symbol {
        flex-basis:
            24px;

        width:
            24px;

        height:
            24px;

        font-size:
            8px;
    }

    .keep-resource-label {
        font-size:
            7px;
    }

    .keep-resource-value {
        font-size:
            11px;
    }

    .keep-kingdom-status-bar {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .keep-kingdom-status-block {
        padding:
            6px;
    }

    .keep-kingdom-status-block:nth-child(odd) {
        border-right:
            1px solid
            rgba(255, 255, 255, 0.045);
    }

    .keep-kingdom-status-block:nth-child(even) {
        border-right:
            0;
    }

    .keep-kingdom-status-block:nth-child(-n + 4) {
        border-bottom:
            1px solid
            rgba(255, 255, 255, 0.04);
    }

    .keep-kingdom-status-title {
        font-size:
            7px;
    }

    .keep-kingdom-status-main {
        font-size:
            11px;
    }

    .keep-tab-bar {
        gap:
            4px;

        min-height:
            42px;

        padding:
            5px 7px;
    }

    .keep-tab {
        padding:
            7px 10px;

        font-size:
            8px;
    }

    .keep-tab-throne::before {
    content: "â™›";

    display: inline-block;

    margin-right: 7px;

    color: #f0d58b;

    font-family: Arial, sans-serif;
    font-size: 10px;
    font-weight: 400;
    line-height: 1;

    text-shadow:
        0 0 8px rgba(217, 180, 93, 0.55);
}
    .keep-command-body {
        display:
            block;

        overflow:
            hidden;
    }

    .keep-command-rail {
        display:
            none;
    }

    .keep-content-stage {
        width:
            100%;

        height:
            100%;
    }

    .keep-dynamic-container {
        padding:
            9px;
    }

    .keep-overview-banner {
        align-items:
            flex-start;

        flex-direction:
            column;

        gap:
            8px;

        padding:
            11px;
    }

    .keep-command-section {
        padding:
            9px;
    }

    .keep-facility-grid,
    .keep-facility-grid-small {
        grid-template-columns:
            1fr;
    }

    .keep-facility-card {
        min-height:
            96px;
    }

    .keep-intelligence-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .keep-overview-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

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

    .keep-resource-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .keep-population-details {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .keep-land-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .keep-economy-grid {
        grid-template-columns:
            1fr;
    }

    .keep-military-grid {
        grid-template-columns:
            1fr;
    }

    .keep-structure-grid,
    .keep-upgrade-grid,
    .keep-tower-grid {
        grid-template-columns:
            1fr;
    }

    .keep-command-footer {
        padding:
            5px 8px;

        font-size:
            7px;
    }

    .keep-throne-card::after {
        top:
            6px;

        right:
            8px;

        font-size:
            27px;
    }

    .keep-throne-panel::before {
        font-size:
            54px;
    }
}


/* ========================================================================== */
/* PHONE                                                                      */
/* ========================================================================== */

@media (max-width: 480px) {

    .keep-command-title {
        font-size:
            17px;

        letter-spacing:
            0.035em;
    }

    .keep-command-subtitle {
        line-height:
            1.35;
    }

    .keep-command-header-right {
        grid-template-columns:
            1fr 1fr 1fr;
    }

    .keep-header-status-value {
        font-size:
            10px;
    }

    .keep-resource-strip {
        grid-template-columns:
            1fr 1fr;
    }

    .keep-kingdom-status-bar {
        grid-template-columns:
            1fr 1fr;
    }

    .keep-tab {
        padding:
            7px 9px;

        font-size:
            7px;
    }

    .keep-overview-grid {
        grid-template-columns:
            1fr;
    }

    .keep-stats-grid {
        grid-template-columns:
            1fr 1fr;
    }

    .keep-resource-grid {
        grid-template-columns:
            1fr 1fr;
    }

    .keep-intelligence-grid {
        grid-template-columns:
            1fr 1fr;
    }

    .keep-population-details {
        grid-template-columns:
            1fr;
    }

    .keep-land-grid {
        grid-template-columns:
            1fr 1fr;
    }

    .keep-facility-icon {
        flex-basis:
            36px;

        width:
            36px;

        height:
            36px;

        font-size:
            7px;
    }

    .keep-facility-title {
        font-size:
            9px;
    }

    .keep-facility-description {
        font-size:
            7px;
    }

    .keep-facility-footer {
        align-items:
            flex-start;

        flex-direction:
            column;

        gap:
            2px;
    }

    .building-header {
        align-items:
            flex-start;

        flex-direction:
            column;

        gap:
            3px;
    }

    .building-effect {
        text-align:
            left;
    }

    .building-meta {
        flex-direction:
            column;

        gap:
            3px;
    }

    .building-actions {
        justify-content:
            stretch;
    }

    .building-actions button {
        width:
            100%;
    }

    .keep-throne-actions {
        flex-direction:
            column;
    }

    .keep-throne-action {
        width:
            100%;
    }

    .keep-throne-card::after {
        font-size:
            23px;
    }

    .keep-command-footer-right {
        display:
            none;
    }

    .keep-command-footer-left {
        width:
            100%;

        justify-content:
            center;

        text-align:
            center;
    }
}


/* ========================================================================== */
/* VERY SMALL PHONES                                                          */
/* ========================================================================== */

@media (max-width: 360px) {

    .keep-command-header-right {
        grid-template-columns:
            1fr;
    }

    .keep-resource-strip {
        grid-template-columns:
            1fr;
    }

    .keep-resource-item {
        border-right:
            0 !important;

        border-bottom:
            1px solid
            rgba(255, 255, 255, 0.04);
    }

    .keep-resource-item:last-child {
        border-bottom:
            0;
    }

    .keep-kingdom-status-bar {
        grid-template-columns:
            1fr;
    }

    .keep-kingdom-status-block {
        border-right:
            0 !important;

        border-bottom:
            1px solid
            rgba(255, 255, 255, 0.04);
    }

    .keep-kingdom-status-block:last-child {
        border-bottom:
            0;
    }

    .keep-stats-grid,
    .keep-resource-grid,
    .keep-intelligence-grid,
    .keep-land-grid {
        grid-template-columns:
            1fr;
    }
}


/* ========================================================================== */
/* REDUCED MOTION                                                             */
/* ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    .keep-panel *,
    .keep-panel *::before,
    .keep-panel *::after {
        scroll-behavior:
            auto !important;

        animation-duration:
            0.001ms !important;

        animation-iteration-count:
            1 !important;

        transition-duration:
            0.001ms !important;
    }
}


/* ========================================================================== */
/* END — SHADOWSKINGS STRONGHOLD COMMAND CENTER                              */
/* ========================================================================== */

/* ========================================================================== */
/* INFRASTRUCTURE CONSTRUCTION                                                */
/* ========================================================================== */

/*
 * Infrastructure cards contain substantially more information than the
 * generic Keep facility cards. They therefore use their own two-column
 * desktop layout instead of the generic four-column facility grid.
 */

.keep-infrastructure-grid {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap:
        12px;
}


.keep-infrastructure-card {
    display:
        grid;

    grid-template-columns:
        58px minmax(0, 1fr);

    grid-template-areas:
        "code name"
        "code description"
        "footer footer"
        "action action";

    align-items:
        start;

    column-gap:
        14px;

    row-gap:
        7px;

    min-height:
        235px;

    padding:
        16px;

    overflow:
        visible;

    cursor:
        default;
}


.keep-infrastructure-card > .keep-facility-code {
    grid-area:
        code;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    width:
        58px;

    height:
        58px;

    margin:
        0;

    border:
        1px solid rgba(154, 91, 195, 0.31);

    border-radius:
        4px;

    background:
        rgba(9, 8, 13, 0.72);

    color:
        #d9cae4;

    font-size:
        14px;

    font-weight:
        900;

    letter-spacing:
        0.04em;
}


.keep-infrastructure-card > .keep-facility-name {
    grid-area:
        name;

    align-self:
        end;

    min-width:
        0;

    color:
        #f0e6f6;

    font-size:
        15px;

    font-weight:
        900;
}


.keep-infrastructure-card > .keep-facility-description {
    grid-area:
        description;

    min-width:
        0;

    max-width:
        none;

    color:
        #95879f;

    font-size:
        10px;

    line-height:
        1.55;
}


.keep-infrastructure-card > .keep-facility-footer {
    grid-area:
        footer;

    display:
        grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap:
        8px;

    width:
        100%;

    margin-top:
        8px;

    padding-top:
        12px;

    border-top:
        1px solid rgba(127, 73, 162, 0.18);
}


.keep-infrastructure-card > .keep-facility-footer > div {
    min-width:
        0;

    padding:
        8px;

    border:
        1px solid rgba(127, 73, 162, 0.12);

    border-radius:
        3px;

    background:
        rgba(8, 7, 12, 0.28);

    color:
        #95879f;

    font-size:
        9px;

    line-height:
        1.45;

    overflow-wrap:
        anywhere;
}


.keep-infrastructure-card > .keep-facility-footer > div:nth-child(4),
.keep-infrastructure-card > .keep-facility-footer > div:nth-child(5) {
    grid-column:
        span 3;
}


.keep-infrastructure-card > .keep-overview-card-btn {
    grid-area:
        action;

    width:
        100%;

    min-height:
        36px;

    margin-top:
        4px !important;

    font-size:
        9px;
}


.keep-infrastructure-card > div[style*="grid-template-columns"] {
    grid-column:
        1 / -1;

    width:
        100%;
}


@media (max-width: 1050px) {

    .keep-infrastructure-grid {
        grid-template-columns:
            1fr;
    }
}


@media (max-width: 650px) {

    .keep-infrastructure-card {
        grid-template-columns:
            46px minmax(0, 1fr);

        min-height:
            0;

        padding:
            12px;
    }


    .keep-infrastructure-card > .keep-facility-code {
        width:
            46px;

        height:
            46px;

        font-size:
            11px;
    }


    .keep-infrastructure-card > .keep-facility-footer {
        grid-template-columns:
            1fr;
    }


    .keep-infrastructure-card > .keep-facility-footer > div,
    .keep-infrastructure-card > .keep-facility-footer > div:nth-child(4),
    .keep-infrastructure-card > .keep-facility-footer > div:nth-child(5) {
        grid-column:
            auto;
    }
}

