/* ==========================================================================
   L'AIDE AUX JOUEURS (js/help.js) et la page Guide du joueur (guide.html)
   ========================================================================== */

/* ---------- Le bouton « ? » ---------- */
.nwh-fab {
    position: fixed;
    left: 18px; bottom: 18px;
    z-index: 900;
    display: grid;
    place-items: center;
    width: 40px; height: 40px;
    border: 1px solid var(--nw-border, rgba(255, 255, 255, .14));
    border-radius: 50%;
    background: var(--nw-glass, rgba(20, 14, 34, .85));
    color: var(--nw-text, #fff);
    font: 800 17px/1 'Archivo', 'Inter', sans-serif;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
    backdrop-filter: blur(10px);
}
.nwh-fab:hover { border-color: rgba(168, 85, 247, .6); }
@media (max-width: 720px) { .nwh-fab { bottom: 86px; left: 12px; } }

/* ---------- Les fenêtres ---------- */
.nwh { position: fixed; inset: 0; z-index: 1200; pointer-events: none; }
.nwh-scrim { position: absolute; inset: 0; background: rgba(5, 3, 12, .55); pointer-events: auto; }
.nwh-card {
    position: absolute;
    pointer-events: auto;
    width: min(420px, calc(100vw - 24px));
    padding: 20px 20px 16px;
    border: 1px solid rgba(168, 85, 247, .35);
    border-radius: 18px;
    background: radial-gradient(120% 90% at 0% 0%, rgba(168, 85, 247, .18), transparent 60%), #120c22;
    color: #f4f1ff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
    animation: nwh-in .22s ease-out both;
}
@keyframes nwh-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .nwh-card { animation: none; } }
.nwh--welcome .nwh-card { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100vw - 24px)); animation: none; }
.nwh--page .nwh-card, .nwh--menu .nwh-card { right: 18px; bottom: 18px; }
@media (max-width: 720px) { .nwh--page .nwh-card, .nwh--menu .nwh-card { right: 12px; bottom: 140px; } }
.nwh-x { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .06); color: inherit; cursor: pointer; }
.nwh-card h2 { display: flex; align-items: center; gap: 8px; margin: 0 30px 8px 0; font: 800 18px/1.25 'Archivo', 'Inter', sans-serif; }
.nwh-card p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: rgba(244, 241, 255, .82); }
.nwh-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.nwh-auto { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; color: rgba(244, 241, 255, .6); cursor: pointer; }
.nwh-mode { display: grid; gap: 3px; margin-bottom: 12px; padding: 10px 12px; border-radius: 12px; font-size: 12.5px; line-height: 1.45; background: rgba(255, 255, 255, .05); }
.nwh-mode b { font-size: 13px; }
.nwh-mode.is-site { border-left: 3px solid #38bdf8; }
.nwh-mode.is-online { border-left: 3px solid #a855f7; }
.nwh-mode.is-place { border-left: 3px solid #f59e0b; }
.nwh-place { margin-top: 2px; }
.nwh-list { display: grid; gap: 6px; }
.nwh-list a, .nwh-list button {
    display: block;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 10px;
    background: rgba(255, 255, 255, .03);
    color: inherit;
    font: inherit;
    font-size: 14px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.nwh-list a:hover, .nwh-list button:hover { border-color: rgba(168, 85, 247, .5); }

:root[data-theme="light"] .nwh-card { background: #fff; color: #1f1633; border-color: rgba(124, 58, 237, .3); }
:root[data-theme="light"] .nwh-card p, :root[data-theme="light"] .nwh-auto { color: #4b4560; }
:root[data-theme="light"] .nwh-mode, :root[data-theme="light"] .nwh-list a, :root[data-theme="light"] .nwh-list button { background: #f6f3ff; border-color: #e7e0fb; }
:root[data-theme="light"] .nwh-fab { background: #fff; color: #1f1633; }

/* ---------- La page Guide du joueur ---------- */
.pg-main { max-width: 1100px; }
.pg-title { margin: 4px 0 8px; font: 900 clamp(28px, 5vw, 44px)/1.05 'Archivo', sans-serif; }
.pg-lead { max-width: 760px; margin-bottom: 22px; color: var(--nw-text-dim); }

.pg-tour { margin-bottom: 22px; padding: 16px 18px; border: 1px solid rgba(168, 85, 247, .3); border-radius: 16px; background: var(--nw-glass); }
.pg-tour header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.pg-tour header em { font-style: normal; font-size: 12.5px; color: var(--nw-text-dim); }
.pg-tour ol { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.pg-tour li { display: flex; gap: 10px; align-items: flex-start; }
.pg-tour-n { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: rgba(168, 85, 247, .18); font-weight: 800; font-size: 12.5px; }
.pg-tour li.is-done .pg-tour-n { background: rgba(34, 197, 94, .22); color: #86efac; }
.pg-tour a { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.pg-tour a em { font-style: normal; font-size: 12.5px; color: var(--nw-text-dim); }

.pg-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 22px; }
.pg-cat { padding: 16px; border: 1px solid var(--nw-border); border-radius: 16px; background: var(--nw-glass); scroll-margin-top: 90px; }
.pg-cat header { display: flex; gap: 12px; margin-bottom: 10px; }
.pg-cat header i { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--tint) 20%, transparent); color: var(--tint); }
.pg-cat header svg { width: 20px; height: 20px; }
.pg-cat h2 { margin: 0; font: 800 17px/1.2 'Archivo', sans-serif; }
.pg-cat header p { margin: 2px 0 0; font-size: 13px; color: var(--nw-text-dim); }
.pg-cat ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.pg-cat a { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.pg-cat a:hover { background: rgba(255, 255, 255, .04); }
.pg-cat a em { font-style: normal; font-size: 12.5px; color: var(--nw-text-dim); }

.pg-where { scroll-margin-top: 90px; }
.pg-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.pg-mode { padding: 12px 14px; border-radius: 12px; background: var(--nw-glass); border-left: 3px solid; }
.pg-mode.is-site { border-color: #38bdf8; }
.pg-mode.is-online { border-color: #a855f7; }
.pg-mode.is-place { border-color: #f59e0b; }
.pg-mode p { margin: 4px 0 0; font-size: 13px; color: var(--nw-text-dim); }
#guideRoot .gd-page { max-width: none; }

/* ---------- Mention de rôle, progression, aides déjà vues ---------- */
.nwh-card .nwh-roles { margin: -4px 0 10px; padding: 6px 10px; border-radius: 10px; font-size: 12.5px; background: rgba(244, 63, 94, .1); color: #fecdd3; }
.nwh-progress { display: grid; gap: 6px; margin: 12px 0 4px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .04); font-size: 13px; }
.nwh-progress a { color: #d8b4fe; text-decoration: none; }
.nwh-bar { display: block; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.nwh-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #a855f7, #22c55e); }
.nwh-seen { margin-top: 10px; font-size: 13px; }
.nwh-seen summary { cursor: pointer; color: rgba(244, 241, 255, .75); margin-bottom: 6px; }
.nwh-list--small { margin-top: 10px; }
.nwh-list--small button { font-size: 13px; padding: 8px 10px; }

/* ---------- La visite guidée ---------- */
.nwh--tour .nwh-spot {
    position: fixed;
    border-radius: 12px;
    box-shadow: 0 0 0 2px #a855f7, 0 0 0 9999px rgba(5, 3, 12, .62);
    pointer-events: none;
    transition: left .18s ease, top .18s ease, width .18s ease, height .18s ease;
}
@media (prefers-reduced-motion: reduce) { .nwh--tour .nwh-spot { transition: none; } }
.nwh--tour .nwh-card { position: fixed; width: min(340px, calc(100vw - 24px)); animation: none; }
.nwh-tip-foot { display: flex; align-items: center; gap: 8px; }
.nwh-tip-foot em { margin-right: auto; font-style: normal; font-size: 12px; color: rgba(244, 241, 255, .6); }

:root[data-theme="light"] .nwh-progress { background: #f6f3ff; }
:root[data-theme="light"] .nwh-progress a { color: #7c3aed; }
:root[data-theme="light"] .nwh-card .nwh-roles { color: #9f1239; }

/* ---------- Guide : aides des espaces et articles du staff ---------- */
.pg-aides { margin-bottom: 22px; scroll-margin-top: 90px; }
.pg-aides h2 { margin: 0 0 10px; font: 800 18px/1.2 'Archivo', sans-serif; }
.pg-aides-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.pg-aide { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--nw-border); border-radius: 12px; background: var(--nw-glass); border-left: 3px solid #38bdf8; }
.pg-aide.is-online { border-left-color: #a855f7; }
.pg-aide.is-place { border-left-color: #f59e0b; }
.pg-aide b { font-size: 14px; }
.pg-aide p { margin: 0; font-size: 12.5px; color: var(--nw-text-dim); }
.pg-aide small { font-size: 12px; color: var(--nw-text-dim); }
.pg-aide-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pg-aide.is-seen b::after { content: ' ✓'; color: #86efac; }
.pg-cat-emoji { font-style: normal; font-size: 20px; }
.pg-article-body p { margin: 0 0 10px; line-height: 1.6; }
.pg-article-roles { display: inline-block; margin-top: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12.5px; background: rgba(244, 63, 94, .12); }
