/* ==========================================================================
   Horror Game Picker — Flashlight in the Dark (bespoke)
   Page chrome is theme-aware (var(--theme-*)); the room itself is always dark
   (a pitch-black room reads the same on any theme — that's the whole point).
   ========================================================================== */
.page-horror-game-picker {
    --hgp-primary: #7c3aed;
    --hgp-glow: #c4b5fd;
    --hgp-grad: linear-gradient(135deg, #7c3aed, #4c1d95);
    --hgp-ink: var(--theme-text, #1f2430);
    /* ⚠️ --theme-muted, NOT --theme-text-muted: the latter is not defined
       anywhere in themes.css, so it silently fell back to the literal on every
       theme and this copy never adapted. */
    --hgp-muted: var(--theme-muted, #6b7280);
    --hgp-surface: var(--theme-surface, #ffffff);
    --hgp-border: var(--theme-border, #e5e7eb);
}

/* ---- Ambient backdrop --------------------------------------------------- */
.page-horror-game-picker::before {
    content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
    background:
        radial-gradient(1100px 560px at 6% -6%, rgba(124, 58, 237, 0.12), transparent 60%),
        radial-gradient(950px 520px at 96% 2%, rgba(76, 29, 149, 0.10), transparent 62%),
        radial-gradient(880px 640px at 50% 108%, rgba(30, 27, 46, 0.10), transparent 60%);
}

/* ---- Stage + dark room -------------------------------------------------- */
.page-horror-game-picker .hgp-stage { position: relative; max-width: 540px; margin: 0 auto; }
.page-horror-game-picker .hgp-stage-wrap { position: relative; }
.page-horror-game-picker #hgpStage { display: block; }
.page-horror-game-picker .hgp-svg { width: 100%; height: auto; display: block; max-height: 66vh; }

.page-horror-game-picker .hgp-frame-outer { fill: #14121c; stroke: var(--hgp-primary); stroke-width: 2; }
.page-horror-game-picker .hgp-room { fill: #0a0910; }
.page-horror-game-picker .hgp-vignette { fill: none; }
.page-horror-game-picker .hgp-marq-t { fill: #6d5f8c; font: 800 12px var(--bs-body-font-family, sans-serif); letter-spacing: 4px; text-anchor: middle; }
.page-horror-game-picker .hgp-beam { mix-blend-mode: screen; }

/* framed portraits */
.page-horror-game-picker .hgp-item-in { transition: opacity .08s linear; }
.page-horror-game-picker .hgp-frame { fill: #191524; stroke-width: 2.4; }
.page-horror-game-picker .hgp-frame-in { fill: #241d33; stroke: rgba(255,255,255,.06); stroke-width: 1; }
.page-horror-game-picker .hgp-emoji { text-anchor: middle; }
.page-horror-game-picker .hgp-plate { fill: rgba(0,0,0,.55); }
.page-horror-game-picker .hgp-lbl {
    font: 700 9px var(--bs-body-font-family, sans-serif); text-anchor: middle; fill: #f3e8ff;
    paint-order: stroke; stroke: rgba(0,0,0,.6); stroke-width: 2px; stroke-linejoin: round;
}
.page-horror-game-picker .hgp-item.is-lit .hgp-frame { filter: drop-shadow(0 0 7px var(--hgp-glow)); }
.page-horror-game-picker .hgp-item.is-lit .hgp-frame { stroke-width: 3; }

/* ---- Start overlay ------------------------------------------------------ */
.page-horror-game-picker .hgp-start-overlay {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3;
    display: inline-flex; align-items: center; gap: .5rem; border: 0; border-radius: 999px;
    padding: .8rem 1.9rem; font-size: 1.05rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
    color: #fff; background: var(--hgp-grad); cursor: pointer; box-shadow: 0 12px 30px -8px rgba(124,58,237,.9);
    animation: hgpPulse 1.9s ease-in-out infinite;
}
.page-horror-game-picker .hgp-start-overlay:hover { filter: brightness(1.1); }
.page-horror-game-picker .hgp-start-overlay[hidden] { display: none; }
@keyframes hgpPulse { 0%,100% { transform: translate(-50%,-50%) scale(1); opacity: .96; } 50% { transform: translate(-50%,-50%) scale(1.05); opacity: 1; } }

/* ---- Winner result bar (shared layout — identity only here) ------------- */
.page-horror-game-picker .wsp-result {
    --wsp-result-accent: var(--hgp-primary);
    --wsp-result-grad: var(--hgp-grad);
    --wsp-result-btn-ink: #ffffff;
    --wsp-result-plate: #efe7fd;
    --wsp-result-tint: rgba(124, 58, 237, .08);
}

.page-horror-game-picker .hgp-count { text-align: center; font-size: .9rem; color: var(--hgp-muted); margin: .7rem 0 .25rem; }
.page-horror-game-picker .hgp-count.is-warn { color: var(--hgp-primary); font-weight: 700; }
.page-horror-game-picker .hgp-effects { display: flex; gap: 1.2rem; justify-content: center; margin-top: .5rem; }
.page-horror-game-picker .hgp-effects label { font-size: .85rem; color: var(--hgp-muted); display: inline-flex; align-items: center; gap: .35rem; }

/* ---- Winner reveal ------------------------------------------------------ */
.page-horror-game-picker .hgp-modal-img { width: 148px; height: 148px; display: inline-block; }
.hgp-modal-img { width: 148px; height: 148px; display: inline-block; }
.hgp-modal-emoji { font-size: 72px; line-height: 1; }

/* ---- Game chooser grid (settings) --------------------------------------- */
.page-horror-game-picker .hgp-item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .5rem; }
.page-horror-game-picker .hgp-chip {
    --chip-c: #7c3aed; position: relative;
    border: 2px solid var(--hgp-border); background: var(--hgp-surface); border-radius: 12px; padding: .5rem .2rem .35rem;
    cursor: pointer; text-align: center; transition: transform .1s ease, border-color .1s ease, box-shadow .1s ease; opacity: .5;
}
.page-horror-game-picker .hgp-chip-e { display: block; font-size: 24px; line-height: 1; margin-bottom: .15rem; }
.page-horror-game-picker .hgp-chip img { width: 58px; height: 58px; display: block; margin: 0 auto .15rem;  object-fit: contain;}
.page-horror-game-picker .hgp-chip-t { font-size: .66rem; font-weight: 700; color: var(--hgp-ink); display: block; line-height: 1.1; }
.page-horror-game-picker .hgp-chip:hover { transform: translateY(-2px); border-color: var(--chip-c); }
.page-horror-game-picker .hgp-chip.is-on { opacity: 1; border-color: var(--chip-c); box-shadow: 0 6px 16px -10px var(--chip-c); }
.page-horror-game-picker .hgp-chip.is-custom { opacity: 1; border-style: dashed; border-color: var(--chip-c); }
.page-horror-game-picker .hgp-chip-x {
    position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; border-radius: 50%;
    background: var(--hgp-primary); color: #fff; font-size: 13px; font-weight: 700; line-height: 18px; text-align: center;
    box-shadow: 0 2px 5px -1px rgba(0,0,0,.4);
}
.page-horror-game-picker .hgp-custom-row { display: flex; gap: .4rem; margin-top: .6rem; }
.page-horror-game-picker .hgp-custom-row input {
    flex: 1 1 auto; border: 1px solid var(--hgp-border); border-radius: 10px; padding: .5rem .7rem; font-size: .9rem;
    background: var(--hgp-surface); color: var(--hgp-ink);
}
.page-horror-game-picker .hgp-custom-row button { border: 0; border-radius: 10px; padding: .5rem .9rem; font-weight: 700; color: #fff; background: var(--hgp-grad); cursor: pointer; }

/* ---- SEO content section ------------------------------------------------ */
.page-horror-game-picker .hgp-content {
    color: var(--hgp-ink);
    background: linear-gradient(180deg, #ffffff 0%, #f5f1fd 100%);
    padding: 3.5rem 0 3.75rem; margin-top: 1rem;
    border-top: 1px solid var(--hgp-border);
}
body[data-theme].page-horror-game-picker .hgp-content { background: var(--theme-bg); }
.page-horror-game-picker .hgp-inner { max-width: 860px; margin: 0 auto; padding: 0 1rem; }
.page-horror-game-picker .hgp-content h2,
.page-horror-game-picker .hgp-content h3 { color: var(--hgp-ink); }
.page-horror-game-picker .hgp-content p,
.page-horror-game-picker .hgp-content li { color: var(--hgp-muted); }
.page-horror-game-picker .hgp-content strong { color: var(--hgp-ink); }
.page-horror-game-picker .hgp-content em { color: var(--hgp-ink); font-style: italic; }
.page-horror-game-picker .hgp-content a { color: var(--hgp-primary); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.page-horror-game-picker .hgp-content a:hover { color: #4c1d95; }

.page-horror-game-picker .hgp-kicker {
    display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
    color: #fff; background: var(--hgp-grad); border-radius: 999px; padding: .3rem .85rem; margin-bottom: .85rem;
}
.page-horror-game-picker .hgp-lead { font-size: 1.2rem; line-height: 1.7; color: var(--hgp-ink); }
.page-horror-game-picker .hgp-section { margin-top: 3rem; }
.page-horror-game-picker .hgp-list { margin: .4rem 0 0; padding-left: 1.15rem; }

.page-horror-game-picker .hgp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; margin-top: 1.4rem; }
.page-horror-game-picker .hgp-step {
    display: flex; gap: .75rem; align-items: flex-start;
    background: var(--hgp-surface); border: 1px solid var(--hgp-border); border-radius: 14px; padding: 1rem 1.05rem;
    box-shadow: 0 10px 24px -18px rgba(124,58,237,.6);
}
.page-horror-game-picker .hgp-step-num {
    flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%;
    font-weight: 800; color: #fff; background: var(--hgp-grad);
}
.page-horror-game-picker .hgp-step-body { min-width: 0; }
.page-horror-game-picker .hgp-step-title { font-weight: 800; color: var(--hgp-ink); margin-bottom: .15rem; }
.page-horror-game-picker .hgp-step-body p { font-size: .9rem; margin: 0; }

.page-horror-game-picker .hgp-table-wrap { overflow-x: auto; margin-top: 1.4rem; }
.page-horror-game-picker .hgp-ctab { width: 100%; border-collapse: collapse; min-width: 520px; font-size: .95rem; }
.page-horror-game-picker .hgp-ctab thead th {
    text-align: left; text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; font-weight: 800;
    color: #fff; background: var(--hgp-primary); padding: .7rem 1rem;
}
.page-horror-game-picker .hgp-ctab tbody td { padding: .65rem 1rem; border-bottom: 1px solid var(--hgp-border); color: var(--hgp-muted); }
.page-horror-game-picker .hgp-ctab tbody td:first-child { font-weight: 800; color: var(--hgp-ink); white-space: nowrap; }
.page-horror-game-picker .hgp-ctab tbody tr:last-child td { border-bottom: 0; }

.page-horror-game-picker .hgp-callout {
    background: var(--hgp-surface); border: 1px solid var(--hgp-border); border-left: 4px solid var(--hgp-primary);
    border-radius: 14px; padding: 1.4rem 1.5rem;
}
.page-horror-game-picker .hgp-callout p { margin-bottom: 0; }

.page-horror-game-picker .hgp-content .accordion { margin-top: 1rem; border-radius: 14px; overflow: hidden; border: 1px solid var(--hgp-border); }
.page-horror-game-picker .hgp-content .accordion-item { border: 0; border-bottom: 1px solid var(--hgp-border); background: var(--hgp-surface); }
.page-horror-game-picker .hgp-content .accordion-item:last-child { border-bottom: 0; }
.page-horror-game-picker .hgp-content .accordion-button { font-weight: 700; color: var(--hgp-ink); background: var(--hgp-surface); }
.page-horror-game-picker .hgp-content .accordion-button:not(.collapsed) { color: var(--hgp-primary); background: var(--hgp-surface); box-shadow: none; }
.page-horror-game-picker .hgp-content .accordion-body { color: var(--hgp-muted); }

@media (max-width: 767.98px) {
    .page-horror-game-picker .hgp-steps { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .page-horror-game-picker .hgp-start-overlay { animation: none; }
}

/* ---- Speed slider (user-facing animation speed) -------------------------- */
.page-horror-game-picker .hgp-speed { margin: .9rem auto .2rem; max-width: 420px; }
.page-horror-game-picker .hgp-speed > label {
    display: flex; align-items: center; gap: .35rem; font-size: .85rem; font-weight: 600;
    color: var(--hgp-muted, #6b7280); margin-bottom: .4rem;
}
.page-horror-game-picker .hgp-speed-val { margin-left: auto; font-weight: 800; color: #7c3aed; font-variant-numeric: tabular-nums; }
.page-horror-game-picker .hgp-srange {
    -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px;
    background: rgba(120,120,120,.25); outline: none; cursor: pointer;
}
.page-horror-game-picker .hgp-srange::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%;
    background: #7c3aed; border: 2px solid #fff; box-shadow: 0 2px 6px -1px rgba(0,0,0,.35);
}
.page-horror-game-picker .hgp-srange::-moz-range-thumb {
    width: 18px; height: 18px; border-radius: 50%; background: #7c3aed; border: 2px solid #fff;
}
.page-horror-game-picker .hgp-srange-ends {
    display: flex; justify-content: space-between; font-size: .72rem;
    color: var(--hgp-muted, #6b7280); opacity: .75; margin-top: .25rem;
}


/* ---- High-contrast -------------------------------------------------------
   HC sets --theme-muted: #1f2937, which is right on its WHITE cards and
   unreadable on its BLACK body (measured 1.43:1). So the content section's
   copy goes light, and every white-surfaced component inside it is restored
   to dark with a more specific selector. Must stay LAST in the file:
   equal-specificity declarations are resolved by source order. */
body[data-theme="high-contrast"].page-horror-game-picker .hgp-content p,
body[data-theme="high-contrast"].page-horror-game-picker .hgp-content li,
body[data-theme="high-contrast"].page-horror-game-picker .hgp-ctab tbody td {
    color: rgba(255, 255, 255, .84);
}
body[data-theme="high-contrast"].page-horror-game-picker .hgp-step-body p,
body[data-theme="high-contrast"].page-horror-game-picker .hgp-step-title,
body[data-theme="high-contrast"].page-horror-game-picker .hgp-step strong,
body[data-theme="high-contrast"].page-horror-game-picker .hgp-callout p,
body[data-theme="high-contrast"].page-horror-game-picker .hgp-callout li,
body[data-theme="high-contrast"].page-horror-game-picker .hgp-callout strong {
    color: #1f2937;
}
