/* Page d’accueil : styles limités à .pm-home-main. */
body.pm-home {
    margin: 0;
    background: #f3f6fa;
    color: #101828;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.pm-home-main {
    --home-card: #fff;
    --home-muted: #667085;
    --home-line: #e4e9f0;
    max-width: 1440px;
    margin: auto;
    padding: 30px 28px 10px;
}

.pm-home-main * { box-sizing: border-box; }
.pm-home-main a { color: inherit; text-decoration: none; }
.pm-home-main .home-note { margin: 0 0 24px; color: var(--home-muted); font-size: 12px; }
.pm-home-main .home-section { margin: 0 0 38px; }
.pm-home-main .home-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.pm-home-main h1,
.pm-home-main h2 { margin: 0 0 7px; font-size: clamp(23px, 2.5vw, 34px); line-height: 1.2; letter-spacing: -.8px; }
.pm-home-main .home-heading p { margin: 0; color: var(--home-muted); line-height: 1.6; }
.pm-home-main .home-heading a { color: #df5100; font-size: 14px; font-weight: 650; white-space: nowrap; }
.pm-home-main a:focus-visible { outline: 3px solid #ff7519; outline-offset: 4px; }

/* Boutiques */
.pm-home-main .home-shops { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.pm-home-main .home-shop { overflow: hidden; padding: 6px; border: 1px solid var(--home-line); border-radius: 14px; background: var(--home-card); }
.pm-home-main .shop-banner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 82px;
    padding: 14px;
    border-radius: 9px;
    background: radial-gradient(ellipse at 80% 15%, #6765ce, transparent 65%), linear-gradient(120deg, #14243b, #283d70);
    color: #fff;
    font-size: 36px;
}
.pm-home-main .shop-banner.blue { background: radial-gradient(ellipse at 80% 15%, #169ab4, transparent 65%), linear-gradient(120deg, #0b223b, #183660); }
.pm-home-main .shop-banner.orange { background: radial-gradient(ellipse at 80% 15%, #e5a55b, transparent 65%), linear-gradient(120deg, #30231c, #86532e); }
.pm-home-main .shop-info { position: relative; padding: 0 12px 12px; }
.pm-home-main .shop-avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-top: -24px;
    overflow: hidden;
    border: 3px solid var(--home-card);
    border-radius: 50%;
    background: #101d31;
    color: #fff;
    font-size: 28px;
}
.pm-home-main .shop-avatar-image { position: absolute; inset: 0; width: 100%; height: 100%; background: var(--home-card); object-fit: cover; }
.pm-home-main .shop-avatar-image[hidden] { display: none; }
.pm-home-main h3 { margin: 12px 0 6px; font-size: 18px; line-height: 1.3; }
.pm-home-main .shop-info h3 { margin: 9px 0 4px; overflow-wrap: anywhere; }
.pm-home-main .shop-info p { margin: 0; color: var(--home-muted); font-size: 13px; line-height: 1.5; }
.pm-home-main .shop-games { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 14px 0; }
.pm-home-main .mini-game { display: flex; align-items: center; justify-content: center; min-width: 0; height: 82px; border-radius: 5px; background: #edf0f8; color: #404b65; font-size: 25px; }
.pm-home-main .shop-games .mini-game { height: 92px; overflow: hidden; background: transparent; }
.pm-home-main .shop-cover { display: block; width: 100%; height: 100%; object-fit: contain; }
.pm-home-main .shop-status { display: block; padding: 12px 8px; border: 1px solid var(--home-line); border-radius: 8px; color: var(--home-muted); font-size: 12px; text-align: center; }
.pm-home-main .shop-visit { display: flex; gap: 12px; width: 100%; padding: 10px 14px; font-size: 14px; }

/* Annonces */
.pm-home-main .home-products { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.pm-home-main .home-product { overflow: hidden; padding: 6px; border: 1px solid var(--home-line); border-radius: 12px; background: var(--home-card); }
.pm-home-main .home-product-link { display: block; height: 100%; border-radius: 8px; }
.pm-home-main .home-product:hover { border-color: #ff9c59; }
.pm-home-main .product-art {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--home-card);
    color: #23324d;
    font-size: 52px;
}
.pm-home-main .product-art.teal { background: linear-gradient(140deg, #c1e5e1, #9fc6cd); }
.pm-home-main .product-art.gold { background: linear-gradient(140deg, #f1e2be, #d2c29d); }
.pm-home-main .product-art.rose { background: linear-gradient(140deg, #f4d4cf, #d8acb5); }
.pm-home-main .product-art.slate { background: linear-gradient(140deg, #bfcad8, #8296ae); }
.pm-home-main .sample-label { position: absolute; top: 8px; left: 8px; padding: 4px 7px; border-radius: 5px; background: #ffffffeb; color: #344054; font-size: 10px; }
.pm-home-main .product-info { padding: 6px 6px 10px; }
.pm-home-main .product-info h3 { margin: 5px 0 7px; font-size: 14px; }
.pm-home-main .product-info p { margin: 5px 0; color: var(--home-muted); font-size: 12px; }
.pm-home-main .home-product-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.pm-home-main .home-image-missing { padding: 14px; color: var(--home-muted); font-size: 12px; text-align: center; }
.pm-home-main .home-image-missing[hidden] { display: none; }
.pm-home-main .home-product-price { display: block; margin-top: 12px; font-size: 18px; }

/* Consoles */
.pm-home-main .home-console-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.pm-home-main .home-console-column { display: grid; gap: 20px; min-width: 0; }
.pm-home-main .home-console-group { overflow: hidden; border: 1px solid var(--home-line); border-radius: 14px; background: var(--home-card); }
.pm-home-main .home-console-group h3 { margin: 0; padding: 19px 20px; border-bottom: 1px solid var(--home-line); background: rgba(127, 139, 167, .06); font-size: 18px; }
.pm-home-main .home-console-list { margin: 0; padding: 8px 12px; list-style: none; }
.pm-home-main .home-console-list li + li { border-top: 1px solid var(--home-line); }
.pm-home-main .home-console-list a { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 8px; border-radius: 7px; line-height: 1.35; overflow-wrap: anywhere; }
.pm-home-main .home-console-list a:hover { background: rgba(127, 139, 167, .12); }
.pm-home-main .home-console-arrow { flex-shrink: 0; color: var(--home-muted); }
.pm-home-main .home-console-ad-count { flex-shrink: 0; color: var(--home-muted); font-size: 12px; white-space: nowrap; }
.pm-home-main .home-console-disabled { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 8px; color: #98a2b3; line-height: 1.35; overflow-wrap: anywhere; }

/* Éléments communs */
.pm-home-main .home-message { padding: 24px; border: 1px solid var(--home-line); border-radius: 12px; background: var(--home-card); color: var(--home-muted); }
.pm-home-main .home-shop-empty { padding: 22px; color: var(--home-muted); font-size: 14px; }
.pm-home-main .home-shop-empty p { margin: 0; }
.pm-home-main .home-invite { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; padding: 18px 22px; border: 1px solid var(--home-line); border-radius: 12px; background: var(--home-card); font-size: 14px; }
.pm-home-main .home-button { display: inline-flex; align-items: center; justify-content: center; padding: 12px 18px; border-radius: 8px; background: #ff7519; color: #fff; font-weight: 650; white-space: nowrap; }
.pm-home-main .home-footer { display: flex; justify-content: space-between; gap: 15px; padding: 22px 0; border-top: 1px solid var(--home-line); color: var(--home-muted); font-size: 12px; }
.pm-home-main .home-pagination { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 24px; font-size: 14px; }
.pm-home-main .home-pagination a { padding: 10px; border: 1px solid var(--home-line); border-radius: 8px; background: var(--home-card); }

/* Contraste du texte des boutons orange, y compris en mode nuit. */
html body.pm-home .pm-home-main a.home-button,
html body.pm-home .pm-home-main a.home-button:visited,
html body.pm-home .pm-home-main a.home-button:hover,
html body.pm-home .pm-home-main a.home-button:focus-visible {
    background: #c44700 !important;
    color: #fff !important;
    font-weight: 700;
    -webkit-text-fill-color: #fff !important;
}
html body.pm-home .pm-home-main a.home-button:hover { background: #a63c00 !important; }
html body.pm-home .pm-home-main a.home-button span { color: inherit !important; -webkit-text-fill-color: inherit !important; }

/* Mode nuit */
html[data-pm-theme="dark"] body.pm-home { background: #0e1829; color: #edf2fa; }
html[data-pm-theme="dark"] .pm-home-main { --home-card: #17253a; --home-muted: #b2bfd2; --home-line: #2d3e56; }
html[data-pm-theme="dark"] .pm-home-main .mini-game { background: #24344c; color: #dbe5f7; }
html[data-pm-theme="dark"] .pm-home-main .home-heading a { color: #ffab70; }

@media (max-width: 1050px) {
    .pm-home-main .home-products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 850px) {
    .pm-home-main .home-console-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .pm-home-main { padding: 24px 16px 6px; }
    .pm-home-main .home-shops { grid-template-columns: 1fr; }
    .pm-home-main .home-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
    .pm-home-main .home-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pm-home-main .product-art { height: 160px; }
    .pm-home-main .home-invite,
    .pm-home-main .home-footer { align-items: flex-start; flex-direction: column; }
    .pm-home-main .shop-banner { height: 76px; padding: 12px; font-size: 34px; }
    .pm-home-main .shop-info { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; column-gap: 12px; padding: 0 12px 12px; }
    .pm-home-main .shop-avatar { grid-column: 1; grid-row: 1 / span 2; margin-top: -18px; }
    .pm-home-main .shop-info h3 { grid-column: 2; grid-row: 1; margin: 0 0 3px; }
    .pm-home-main .shop-info > p { grid-column: 2; grid-row: 2; }
    .pm-home-main .shop-games { grid-column: 1 / -1; }
    .pm-home-main .shop-games .mini-game { height: 82px; }
    .pm-home-main .shop-visit { grid-column: 1 / -1; }
}

@media (max-width: 540px) {
    .pm-home-main .home-console-grid { grid-template-columns: 1fr; }
}
