.launcher-preview-wrapper {
    position: relative;
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    aspect-ratio: 16 / 9;
    font-family: 'Poppins', 'Space Grotesk', sans-serif;
    font-weight: 700;
    user-select: none;
}

/* ─── Variables du launcher (thème sombre par défaut) ─── */
/* Les variables originales (--element-color, --background, etc.) sont
   modifiables par le CSS utilisateur via l'éditeur. Les variables --lp-*
   héritent des originales pour que les styles du preview se mettent à jour. */
.launcher-preview {
    /* Variables originales du launcher (surchargeables par l'éditeur CSS) */
    --element-color: #5EBB4A;
    --color: #F5F5F5;
    --background: #292929;
    --background-element: #424242;
    --background-transparent: #2c2c2ccc;
    --shadow: rgba(25, 25, 25, 0.7);
    --dark-color: #292929;
    --light-color: rgb(245, 245, 245);

    /* Variables internes du preview (héritent des originales) */
    --lp-element-color: var(--element-color);
    --lp-color: var(--color);
    --lp-background: var(--background);
    --lp-background-element: var(--background-element);
    --lp-background-transparent: var(--background-transparent);
    --lp-shadow: var(--shadow);
    --lp-dark-color: var(--dark-color);
    --lp-light-color: var(--light-color);

    position: relative;
    width: 100%;
    height: 100%;
    color: var(--lp-color);
    background-color: var(--lp-background);
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
}

.launcher-preview.lp-light {
    --color: #151515;
    --background: rgb(245, 245, 245);
    --background-element: #c2c2c2;
    --background-transparent: rgba(204, 204, 204, 0.8);
    --shadow: rgba(208, 208, 208, 0.7);
}

/* ─── Barre de titre macOS (dragbar) ─── */
.lp-titlebar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20px;
    z-index: 10;
    display: flex;
    align-items: center;
    padding-left: 10px;
    gap: 5px;
}

.lp-titlebar-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.lp-titlebar-dot.red { background: #ff6047; }
.lp-titlebar-dot.yellow { background: #ffbd2e; }
.lp-titlebar-dot.green { background: #07d014; }

/* ─── Conteneur principal ─── */
.lp-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    overflow: hidden;
}

/* ═══════════ STATUS SERVER ═══════════ */
.lp-status-server {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--lp-background);
    width: 55%;
    max-width: 300px;
    height: auto;
    color: var(--lp-color);
    border-radius: 8px;
    margin-top: 8%;
    padding: 6px 10px;
    text-align: center;
    gap: 8px;
}

.lp-status-icon {
    height: 28px;
    width: 28px;
    border-radius: 4px;
    object-fit: contain;
    flex-shrink: 0;
}

.lp-status-infos {
    flex: 1;
    min-width: 0;
}

.lp-status-name {
    font-size: 11px;
    color: var(--lp-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lp-status-text {
    font-size: 7px;
    color: #1AC707;
}

.lp-player-count {
    background: var(--lp-shadow);
    min-width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
    position: relative;
}

.lp-player-count::after {
    position: absolute;
    content: '';
    width: 7px;
    height: 7px;
    top: -3px;
    right: -3px;
    border-radius: 50%;
    border: solid 3px var(--lp-background);
    background: #1AC707;
}

/* ═══════════ HOME BOTTOM (news + social) ═══════════ */
.lp-home-bottom {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* ─── News tab ─── */
.lp-news-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 85%;
    height: 100%;
    overflow: hidden;
}

.lp-news-title {
    margin-top: 6px;
    font-size: 13px;
    padding: 3px 10px;
    border-radius: 12px;
    background: var(--lp-background-transparent);
    color: var(--lp-color);
    flex-shrink: 0;
}

.lp-news-list {
    width: 90%;
    flex: 1;
    border-radius: 8px;
    margin: 6px 0;
    overflow: hidden;
}

.lp-news-block {
    width: 100%;
    margin: 0 0 6px 0;
    border-radius: 8px;
    background: var(--lp-background-transparent);
}

.lp-news-header {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    align-items: center;
    gap: 6px;
}

.lp-news-header .lp-news-icon {
    height: 22px;
    width: 22px;
    border-radius: 3px;
    object-fit: contain;
    flex-shrink: 0;
}

.lp-news-header-text {
    flex: 1;
    min-width: 0;
}

.lp-news-header-text .lp-news-title-text {
    text-decoration: underline;
    text-underline-offset: 2px;
    font-size: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lp-news-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.lp-news-date .lp-day {
    font-size: 9px;
    line-height: 1.1;
}

.lp-news-date .lp-month {
    font-size: 6px;
    line-height: 1.1;
}

.lp-news-content {
    padding: 0 10px 6px;
    font-size: 7px;
    font-weight: 400;
    line-height: 1.4;
}

.lp-news-content p {
    margin: 0;
}

/* ─── Social tab ─── */
.lp-social-tab {
    position: absolute;
    display: flex;
    flex-direction: column;
    bottom: 0;
    right: 0;
    width: 15%;
    height: calc(80% - 6px);
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 6px;
    gap: 6px;
    overflow-y: auto;
}

.lp-social-block {
    display: flex;
    background: var(--lp-background-transparent);
    width: 42px;
    height: 42px;
    border-radius: 6px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lp-social-block .lp-social-icon {
    width: 55%;
    height: 55%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* SVG social icons filtré pour couleur claire sur fond sombre */
.lp-social-block .lp-social-icon svg {
    width: 100%;
    height: 100%;
    fill: var(--lp-color);
    opacity: 0.9;
}

/* ═══════════ SIDEBAR (bas du launcher) ═══════════ */
.lp-sidebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 50px;
    background: var(--lp-background-transparent);
    flex-shrink: 0;
}

.lp-player-head {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background-size: cover;
    image-rendering: pixelated;
    margin-left: 12px;
    flex-shrink: 0;
    background-color: var(--lp-background-element);
    background-image: url("/assets/images/setve.png");
}

.lp-play-elements {
    display: flex;
    justify-content: center;
    align-items: center;
}

.lp-play-instance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    border: solid 2px var(--lp-element-color);
    border-radius: 10px;
    height: 28px;
    padding-right: 18px;
}

.lp-play-btn {
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--lp-color);
    font-size: 13px;
    font-weight: 700;
    padding: 0 10px;
    font-family: inherit;
}

.lp-instance-select {
    display: flex;
    align-items: center;
    position: absolute;
    right: -2px;
    top: -2px;
    color: var(--lp-element-color);
    font-size: 8px;
    height: calc(100% + 2px);
    border: solid 2px var(--lp-element-color);
    text-align: center;
    border-radius: 10px;
    padding: 0 4px;
}

.lp-instance-select svg {
    width: 10px;
    height: 10px;
    fill: var(--lp-element-color);
    transform: rotate(270deg);
}

.lp-settings-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lp-element-color);
    margin-right: 12px;
    flex-shrink: 0;
}

.lp-settings-btn svg {
    width: 100%;
    height: 100%;
    fill: var(--lp-element-color);
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 640px) {
    .lp-status-server {
        width: 70%;
    }
    
    .lp-news-header-text .lp-news-title-text {
        font-size: 7px;
    }
    
    .lp-social-block {
        width: 32px;
        height: 32px;
    }
    
    .lp-sidebar {
        height: 40px;
    }
    
    .lp-play-btn {
        font-size: 11px;
    }
}

/* ═══════════ TOGGLE DARK/LIGHT ═══════════ */
.lp-theme-toggle {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 20;
    display: flex;
    gap: 2px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    padding: 2px;
}

.lp-theme-toggle button {
    padding: 3px 6px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-weight: 600;
}

.lp-theme-toggle button.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* ═══════════ EMPTY STATE ═══════════ */
.lp-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 8px;
    opacity: 0.6;
}

.lp-empty-state .lp-empty-icon {
    font-size: 32px;
    opacity: 0.4;
}

.lp-empty-state .lp-empty-text {
    font-size: 10px;
    font-weight: 400;
}
