.external-icon-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.74);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s ease;
    opacity: 0.7;
    filter: grayscale(100%);
}

.external-icon-btn:hover {
    color: #ffffff;
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.06);
}

.settings-gear-btn {
    font-size: 1.35rem;
    line-height: 1;
}

.settings-modal-content {
    width: min(460px, calc(100vw - 32px));
    text-align: left;
}

.settings-panel {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-builder-link {
    display: inline-flex;
    align-self: flex-start;
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease, text-shadow 0.2s ease;
    margin-bottom: 2px;
}

.settings-builder-link:hover {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 230, 255, 0.3);
}

.settings-module {
    border: 1px solid rgba(0, 230, 255, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.settings-module-header {
    padding: 14px 18px 10px;
    border-bottom: 1px solid rgba(0, 230, 255, 0.12);
    background: rgba(0, 230, 255, 0.04);
}

.settings-module-title {
    margin: 0;
    color: var(--text-main);
    font-size: 0.98rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.settings-module-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: var(--text-main);
}

.settings-toggle-row span {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-toggle-row small {
    color: var(--text-muted);
    line-height: 1.45;
}

.settings-toggle-row input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--accent);
    cursor: pointer;
    flex: 0 0 auto;
}

@media (max-width: 560px) {
    .settings-toggle-row {
        align-items: flex-start;
        gap: 14px;
    }
}

.xp-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    overflow-y: auto;
    overflow-x: hidden;
}

.xp-popup-window {
    width: min(700px, 100%);
    max-height: min(92vh, 920px);
    border: 2px solid #1f4fbf;
    border-radius: 8px;
    overflow: hidden;
    background: #ece9d8;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    font-family: Tahoma, Verdana, sans-serif;
    color: #111111;
    display: flex;
    flex-direction: column;
}

.xp-popup-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 8px;
    background: linear-gradient(180deg, #1b79f2 0%, #1658d6 55%, #0b4ab5 100%);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
}

.xp-popup-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.xp-popup-close {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 4px;
    background: linear-gradient(180deg, #ff8585 0%, #f03a3a 100%);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.xp-popup-body {
    padding: 18px 18px 20px;
    background: #fffbea;
    overflow-y: auto;
    overflow-x: hidden;
}

.xp-popup-headline {
    margin: 0 0 12px;
    font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 0.95;
    letter-spacing: 0.05em;
    text-align: center;
    color: #e21515;
    text-transform: uppercase;
    text-shadow: 2px 2px 0 #ffd34d;
}

.xp-popup-headline-site-style {
    font-family: "Segoe UI", Tahoma, sans-serif;
    font-size: clamp(1.8rem, 4vw, 3.4rem);
    line-height: 1.08;
    letter-spacing: 0;
    text-transform: none;
    text-shadow: none;
}

.xp-popup-headline-site-style > span {
    display: inline-block;
    max-width: 100%;
    white-space: pre-line;
}

.xp-popup-headline-site-style .artist-3d,
.xp-popup-headline-site-style .dev-rainbow,
.xp-popup-headline-site-style .thanks-rainbow,
.xp-popup-headline-site-style .data-miner,
.xp-popup-headline-site-style .bug-hunter {
    font-size: inherit;
}

.xp-popup-headline-variant-light > span {
    -webkit-text-stroke: 1.5px rgba(35, 15, 65, 0.78);
    text-shadow:
        0 2px 0 rgba(255, 255, 255, 0.92),
        0 4px 0 rgba(16, 16, 32, 0.35),
        0 0 10px rgba(255, 255, 255, 0.55);
    filter: drop-shadow(0 3px 0 rgba(18, 12, 32, 0.28));
}

.xp-popup-headline-variant-light .artist-3d {
    color: #fffaff;
    text-shadow:
        1px 1px 0 #e10cd1,
        2px 2px 0 #e10cd1,
        3px 3px 0 #14d856,
        4px 4px 0 rgba(27, 14, 45, 0.35),
        0 0 10px rgba(255, 255, 255, 0.75);
}

.xp-popup-headline-variant-light .dev-rainbow,
.xp-popup-headline-variant-light .thanks-rainbow,
.xp-popup-headline-variant-light .data-miner,
.xp-popup-headline-variant-light .bug-hunter {
    filter: drop-shadow(0 3px 0 rgba(22, 12, 38, 0.25));
}

.xp-popup-headline-variant-neon > span {
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.55);
    text-shadow:
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 18px rgba(0, 230, 255, 0.45);
}

.xp-popup-content {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(180px, 0.9fr);
    gap: 18px;
    align-items: center;
}

.xp-popup-copy {
    font-size: 1rem;
    line-height: 1.5;
}

.xp-popup-copy p {
    margin: 0;
    white-space: pre-line;
}

.xp-popup-image-frame {
    padding: 8px;
    border: 1px solid #7f9db9;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px #dfe8f6;
}

.xp-popup-image {
    display: block;
    width: 100%;
    height: auto;
}

.xp-popup-footer {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #a7b8cf;
}

.xp-popup-disclaimer {
    margin: 0 0 14px;
    color: #4f4b39;
    font-size: 0.88rem;
    line-height: 1.45;
    text-align: left;
}

.xp-popup-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.xp-popup-action-group {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}

.xp-popup-button {
    min-width: 116px;
    padding: 7px 18px;
    border: 1px solid #5a5a5a;
    border-radius: 4px;
    background: linear-gradient(180deg, #ffffff 0%, #e5e5e5 100%);
    color: #111111;
    font: 400 0.95rem Tahoma, Verdana, sans-serif;
    cursor: pointer;
}

.xp-popup-button:hover {
    background: linear-gradient(180deg, #fffdf2 0%, #dfefff 100%);
}

.xp-popup-button-disable {
    min-width: 146px;
}

@media (max-width: 640px) {
    .xp-popup-overlay {
        align-items: flex-start;
        padding: 10px;
    }

    .xp-popup-window {
        width: 100%;
        max-height: calc(100dvh - 20px);
        margin: 0 auto;
    }

    .xp-popup-body {
        padding: 14px 14px 16px;
    }

    .xp-popup-content {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .xp-popup-headline {
        font-size: clamp(1.6rem, 9vw, 2.8rem);
        letter-spacing: 0.02em;
    }

    .xp-popup-headline-site-style {
        font-size: clamp(1.45rem, 8vw, 2.35rem);
    }

    .xp-popup-copy {
        font-size: 0.95rem;
    }

    .xp-popup-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .xp-popup-action-group {
        width: 100%;
        justify-content: stretch;
        flex-direction: column;
    }

    .xp-popup-button {
        width: 100%;
    }
}
