.kingdom-shell {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    background:
        radial-gradient(
            circle at 50% 30%,
            #25364a,
            #101722 60%,
            #080c12
        );
    color: #f4efe2;
}

.kingdom-shell[hidden] {
    display: none;
}

.kingdom-shell__header {
    min-height: 64px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 16px;
    padding:
        max(10px, env(safe-area-inset-top))
        max(14px, env(safe-area-inset-right))
        10px
        max(14px, env(safe-area-inset-left));
    background: rgba(7, 11, 17, 0.9);
    border-bottom: 1px solid rgba(220, 186, 108, 0.28);
    backdrop-filter: blur(12px);
}

.kingdom-shell__header h2,
.kingdom-shell__header small {
    margin: 0;
}

.kingdom-shell__header small {
    color: #c8a95f;
}

.kingdom-shell__balance {
    display: flex;
    align-items: center;
    gap: 6px;
    font-variant-numeric: tabular-nums;
}

.kingdom-shell__close {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.kingdom-shell__viewport {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.kingdom-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 12px;
    padding: 24px;
    text-align: center;
}

.kingdom-placeholder strong {
    font-size: clamp(32px, 8vw, 72px);
}

.kingdom-placeholder span {
    color: rgba(255, 255, 255, 0.66);
}

.kingdom-placeholder button {
    margin-top: 20px;
    padding: 14px 18px;
    border: 1px solid rgba(220, 186, 108, 0.55);
    border-radius: 12px;
    background: rgba(21, 31, 44, 0.94);
    color: #f4efe2;
    cursor: pointer;
}

.kingdom-shell__panel {
    position: absolute;
    z-index: 2;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    width: min(380px, calc(100vw - 32px));
    padding: 20px;
    border: 1px solid rgba(220, 186, 108, 0.4);
    border-radius: 18px;
    background: rgba(10, 16, 24, 0.96);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.kingdom-shell__panel[hidden] {
    display: none;
}

.kingdom-shell__panel h3 {
    margin: 4px 0 12px;
}

.kingdom-shell__panel > button {
    float: right;
}

@media (max-width: 600px) {
    .kingdom-shell__panel {
        left: 12px;
        right: 12px;
        bottom: max(
            12px,
            env(safe-area-inset-bottom)
        );
        width: auto;
    }
}
