/* ==========================================================================
   HP Spell Picker — the Wand Cast (Harry Potter category)
   Only page on wand-cast-engine.js. A wand held at the bottom-left of a night
   sky in which every spell is a STAR: sparks gather into a wisp that drifts
   star to star and settles, the wand waves and fires a beam — and then every
   spell ends DIFFERENTLY (Lumos floods white, Nox snaps black and holds it,
   Wingardium Leviosa lifts the name plate, Levicorpus hangs it upside down).
   ⚠️ v1 put the wand at the centre of a RING and turned it like a clock hand,
   which is structurally a wheel with a wand for a pointer — the owner called it
   ("bottle spin / clock") and he was right. The scatter and the wandering wisp
   are what fix it; do not reintroduce a circle.
   Page chrome is theme-aware (var(--theme-*)); the sky, the wand and the stars
   stay fixed — they are physical objects, not themed surfaces.
   ⚖️ Original artwork only: a generic wand, a generic star, and one plain object
   emblem per spell. No logos, no likenesses, no reproduced wording.
   ========================================================================== */
.page-hp-spell-picker {
    --wcs-primary: #7b4bb5;
    --wcs-accent: #e0c072;
    --wcs-grad: linear-gradient(135deg, #e8c766, #7b4bb5);
    --wcs-ink: var(--theme-text, #1f2430);
    /* ⚠️ --theme-muted, NOT --theme-text-muted — the latter is not defined in
       themes.css and silently falls back to its literal on every theme. */
    --wcs-muted: var(--theme-muted, #6b7280);
    --wcs-surface: var(--theme-surface, #ffffff);
    --wcs-border: var(--theme-border, #e5e7eb);
    --wcs-display: 'Harry P', 'Cinzel Decorative', Georgia, serif;
    /* the emblems ship with no background of their own, so each surface supplies
       a parchment plate — swapped-in art stays legible on a dark theme */
    --wcs-plate: #f3e6c6;
}

/* ---- Ambient backdrop --------------------------------------------------- */
.page-hp-spell-picker::before {
    content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
    background:
        radial-gradient(1040px 560px at 6% -6%, rgba(123, 75, 181, 0.18), transparent 60%),
        radial-gradient(920px 520px at 96% 4%, rgba(224, 192, 114, 0.12), transparent 62%),
        radial-gradient(880px 620px at 50% 108%, rgba(20, 12, 40, 0.12), transparent 60%);
}

/* ---- Stage -------------------------------------------------------------- */
.page-hp-spell-picker .wcs-stage { position: relative; max-width: 600px; margin: 0 auto; }
.page-hp-spell-picker .wcs-stage-wrap { position: relative; }
.page-hp-spell-picker #wcsStage { display: block; }
.page-hp-spell-picker .wcs-svg {
    width: 100%; height: auto; display: block; max-height: 72vh; border-radius: 16px;
    filter: drop-shadow(0 14px 34px rgba(16, 8, 32, .55));
}
.page-hp-spell-picker .wcs-scene,
.page-hp-spell-picker .wcs-veil,
.page-hp-spell-picker .wcs-halo,
.page-hp-spell-picker .wcs-fx,
.page-hp-spell-picker .wcs-plate { pointer-events: none; }

/* ---- Stars --------------------------------------------------------------
   Each spell is a star in the sky, NOT a token on a ring. NOTE: .wcs-star is
   positioned by an SVG transform ATTRIBUTE from JS and .wcs-star-anim is
   reserved for attribute-driven motion, so every CSS keyframe lives on the
   INNER .wcs-star-tw wrapper. A CSS transform on an element that also carries a
   transform attribute replaces the attribute outright. */
.page-hp-spell-picker .wcs-star { transition: opacity .35s ease; }
.page-hp-spell-picker .wcs-star.is-dim { opacity: .18; }
/* the soft coloured bed the emblem sits on — this is what makes a star read as
   a star rather than a picture floating in the dark, and it carries the spell's
   colour identity now that there is no parchment plate out here */
.page-hp-spell-picker .wcs-star-bed { opacity: .30; filter: blur(5px); }
.page-hp-spell-picker .wcs-star-tip { opacity: .34; }
/* ⭐ THE EMBLEM IS THE SAME FILE THE CHIP USES. It is drawn as dark ink on a
   parchment disc, which would simply vanish on a night sky — so CSS turns it to
   light out here instead of shipping a second set of 20 files. invert() is
   deliberate rather than a flat white silhouette: it PRESERVES the tonal
   separation, so the pale highlights that punch the skull's eye sockets, the
   keyhole and the shield band become dark holes in a light shape instead of
   merging into it. Works on any format the owner drops in, too. */
.page-hp-spell-picker .wcs-star-art {
    filter: invert(1) sepia(.55) saturate(3.1) hue-rotate(347deg) brightness(1.08)
            drop-shadow(0 0 3px rgba(255, 238, 184, .8));
}
.page-hp-spell-picker .wcs-star.is-target .wcs-star-art { filter: invert(1) sepia(.35) saturate(2.2) brightness(1.3) drop-shadow(0 0 9px rgba(255, 246, 216, 1)); }
.page-hp-spell-picker .wcs-star.is-target .wcs-star-bed { opacity: .62; }
.page-hp-spell-picker .wcs-star-tw { animation-name: wcsTwinkle; animation-timing-function: ease-in-out; animation-iteration-count: infinite; }
@keyframes wcsTwinkle {
    0%, 100% { transform: scale(.94); opacity: .82; }
    50% { transform: scale(1.06); opacity: 1; }
}
.page-hp-spell-picker .wcs-star-tw.is-flare { animation: wcsFlare .5s ease-out 1; }
@keyframes wcsFlare { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.42); } }

/* ---- Wand, wisp, veil --------------------------------------------------- */
.page-hp-spell-picker .wcs-wand { filter: drop-shadow(0 3px 9px rgba(0, 0, 0, .6)); }
.page-hp-spell-picker .wcs-tip { animation: wcsTip 2.2s ease-in-out infinite; transform-origin: center; }
@keyframes wcsTip { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
/* the wisp is the pointer — a loose light, never a hand on a pivot */
.page-hp-spell-picker .wcs-wisp { pointer-events: none; }
.page-hp-spell-picker .wcs-veil { transition: none; }

/* ---- Effect primitives (one per end effect that needs stroking) ---------- */
.page-hp-spell-picker .wcs-fx-beam { stroke-width: 6; stroke-linecap: round; fill: none; filter: drop-shadow(0 0 8px currentColor); }
.page-hp-spell-picker .wcs-fx-trail { fill: #ffeeb8; }
.page-hp-spell-picker .wcs-fx-spark { fill: #ffe9a8; }
.page-hp-spell-picker .wcs-fx-ring { stroke-width: 3; fill: none; }
.page-hp-spell-picker .wcs-fx-ripple { fill: none; }
.page-hp-spell-picker .wcs-fx-shield { stroke-width: 4; fill: none; }
.page-hp-spell-picker .wcs-fx-shield-in { stroke-width: 2; fill: none; stroke-dasharray: 7 6; }
.page-hp-spell-picker .wcs-fx-jet { stroke-width: 9; stroke-linecap: round; fill: none; opacity: .9; }
.page-hp-spell-picker .wcs-fx-slash { stroke-width: 9; stroke-linecap: round; fill: none; }
.page-hp-spell-picker .wcs-fx-cut { stroke-width: 3; stroke-linecap: round; fill: none; }
.page-hp-spell-picker .wcs-fx-glint { stroke-width: 3; stroke-linecap: round; fill: none; }

@media (prefers-reduced-motion: reduce) {
    .page-hp-spell-picker .wcs-star-tw,
    .page-hp-spell-picker .wcs-star-tw.is-flare,
    .page-hp-spell-picker .wcs-tip { animation: none; }
}

/* ---- Name plate --------------------------------------------------------- */
.page-hp-spell-picker .wcs-plate-bg { fill: #f6ecd2; stroke: #3a2810; stroke-width: 2; }
.page-hp-spell-picker .wcs-plate-in { stroke: #a8742a; stroke-width: 1.4; opacity: .75; }
.page-hp-spell-picker .wcs-plate-t {
    text-anchor: middle; fill: #2c1a08; font-weight: 400;
    font-family: var(--wcs-display); letter-spacing: .03em;
}

/* ---- Start overlay ------------------------------------------------------ */
.page-hp-spell-picker .wcs-start-overlay {
    position: absolute; left: 50%; top: 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: #2a1d08; background: var(--wcs-grad); cursor: pointer; box-shadow: 0 12px 30px -8px rgba(30, 14, 60, .95);
    animation: wcsStartPulse 1.8s ease-in-out infinite;
}
.page-hp-spell-picker .wcs-start-overlay:hover { filter: brightness(1.08); }
.page-hp-spell-picker .wcs-start-overlay[hidden] { display: none; }
@keyframes wcsStartPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}

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

/* ---- Result bar ---------------------------------------------------------
   Markup + behaviour + layout are shared (winner-result-bar.php / .css /
   winner-result.js). This page only supplies its colour identity. */
.page-hp-spell-picker .wsp-result {
    --wsp-result-accent: var(--wcs-primary);
    --wsp-result-grad: var(--wcs-grad);
    --wsp-result-btn-ink: #2a1d08;
    --wsp-result-plate: var(--wcs-plate);
    --wsp-result-display: var(--wcs-display);
    --wsp-result-tint: linear-gradient(135deg, rgba(224, 192, 114, .13), rgba(123, 75, 181, .10));
}

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

/* ---- Winner reveal ------------------------------------------------------ */
.page-hp-spell-picker .wcs-modal-img,
.wcs-modal-img {
    width: 168px; height: 168px; display: inline-block; object-fit: contain;
    background: #f3e6c6; border-radius: 50%; padding: 14px;
    box-shadow: inset 0 0 0 3px rgba(123, 75, 181, .5);
}
.wcs-modal-ink {
    width: 168px; height: 168px; display: inline-block;
    background: #f3e6c6; border-radius: 50%; padding: 22px;
    box-shadow: inset 0 0 0 3px rgba(123, 75, 181, .5);
}
.wcs-modal-ink svg { width: 100%; height: 100%; display: block; }
.page-hp-spell-picker #winnerName {
    font-family: var(--wcs-display); font-weight: 400; letter-spacing: .02em; font-size: 2.1rem;
}
.page-hp-spell-picker h1,
.page-hp-spell-picker .wcs-kicker { font-family: var(--wcs-display); letter-spacing: .03em; }

/* ---- Spell chooser grid (settings) -------------------------------------- */
.page-hp-spell-picker .wcs-item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .5rem; }
.page-hp-spell-picker .wcs-chip {
    --chip-c: #7b4bb5; position: relative;
    border: 2px solid var(--wcs-border); background: var(--wcs-surface); border-radius: 10px; padding: .5rem .3rem .4rem;
    cursor: pointer; text-align: center; transition: transform .1s ease, border-color .1s ease, box-shadow .1s ease; opacity: .55;
}
.page-hp-spell-picker .wcs-chip img,
.page-hp-spell-picker .wcs-chip-ink {
    width: 58px; height: 58px; display: block; margin: 0 auto .25rem; object-fit: contain;
    background: var(--wcs-plate); border-radius: 50%; padding: 5px;
    box-shadow: inset 0 0 0 1.5px rgba(123, 75, 181, .45);
}
.page-hp-spell-picker .wcs-chip-ink svg { width: 100%; height: 100%; display: block; }
.page-hp-spell-picker .wcs-chip-t { font-size: .68rem; font-weight: 700; color: var(--wcs-ink); display: block; line-height: 1.15; }
.page-hp-spell-picker .wcs-chip:hover { transform: translateY(-2px); border-color: var(--chip-c); }
.page-hp-spell-picker .wcs-chip.is-on { opacity: 1; border-color: var(--chip-c); box-shadow: 0 6px 16px -10px var(--chip-c); }
.page-hp-spell-picker .wcs-chip.is-custom { opacity: 1; border-style: dashed; border-color: var(--chip-c); }
.page-hp-spell-picker .wcs-chip-x {
    position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; border-radius: 50%;
    background: var(--wcs-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-hp-spell-picker .wcs-custom-row { display: flex; gap: .4rem; margin-top: .6rem; }
.page-hp-spell-picker .wcs-custom-row input {
    flex: 1 1 auto; border: 1px solid var(--wcs-border); border-radius: 10px; padding: .5rem .7rem; font-size: .9rem;
    background: var(--wcs-surface); color: var(--wcs-ink);
}
.page-hp-spell-picker .wcs-custom-row button { border: 0; border-radius: 10px; padding: .5rem .9rem; font-weight: 700; color: #2a1d08; background: var(--wcs-grad); cursor: pointer; }

/* ---- SEO content section ------------------------------------------------
   Colour + accents ONLY. The type scale comes from the shared .content-guide
   class on the wrapper — never re-declare heading font sizes here. */
.page-hp-spell-picker .wcs-content {
    color: var(--wcs-ink);
    background: linear-gradient(180deg, #ffffff 0%, #f7f3fc 100%);
    padding: 3.5rem 0 3.75rem; margin-top: 1rem;
    border-top: 1px solid var(--wcs-border);
}
body[data-theme].page-hp-spell-picker .wcs-content { background: var(--theme-bg); }
.page-hp-spell-picker .wcs-inner { max-width: 860px; margin: 0 auto; padding: 0 1rem; }
.page-hp-spell-picker .wcs-content h2,
.page-hp-spell-picker .wcs-content h3 { color: var(--wcs-ink); }
.page-hp-spell-picker .wcs-content p,
.page-hp-spell-picker .wcs-content li { color: var(--wcs-muted); }
.page-hp-spell-picker .wcs-content strong { color: var(--wcs-ink); }
.page-hp-spell-picker .wcs-content em { color: var(--wcs-ink); font-style: italic; }
.page-hp-spell-picker .wcs-content a { color: var(--wcs-primary); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.page-hp-spell-picker .wcs-content a:hover { color: #57307f; }

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

/* ---- Signature section shape: a numbered LEDGER, deliberately different
   from the map page's two-column split and the professor page's card deck. -- */
.page-hp-spell-picker .wcs-ledger { margin-top: 1.4rem; border-top: 2px solid var(--wcs-accent); }
.page-hp-spell-picker .wcs-row {
    display: grid; grid-template-columns: 46px 1fr; gap: 1rem; align-items: start;
    padding: 1.05rem .2rem; border-bottom: 1px solid var(--wcs-border);
}
.page-hp-spell-picker .wcs-row-n {
    width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px;
    font-weight: 800; font-size: .95rem; color: #2a1d08; background: var(--wcs-grad);
}
.page-hp-spell-picker .wcs-row h3 { margin: 0 0 .25rem !important; font-size: 1.05rem !important; }
.page-hp-spell-picker .wcs-row p { margin: 0; font-size: .95rem; }

/* signature asset — the 20-row spell / effect table */
.page-hp-spell-picker .wcs-table-wrap { overflow-x: auto; margin-top: 1.4rem; }
.page-hp-spell-picker .wcs-ctab { width: 100%; border-collapse: collapse; min-width: 660px; font-size: .95rem; }
.page-hp-spell-picker .wcs-ctab thead th {
    text-align: left; text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; font-weight: 800;
    color: #2a1d08; background: var(--wcs-accent); padding: .7rem 1rem;
}
.page-hp-spell-picker .wcs-ctab tbody td { padding: .7rem 1rem; border-bottom: 1px solid var(--wcs-border); vertical-align: top; }
.page-hp-spell-picker .wcs-ctab tbody tr:nth-child(even) { background: rgba(123, 75, 181, .05); }
.page-hp-spell-picker .wcs-ctab tbody td:first-child { font-weight: 700; color: var(--wcs-ink); white-space: nowrap; }

.page-hp-spell-picker .wcs-callout {
    margin-top: 1.4rem; border-left: 4px solid var(--wcs-primary); border-radius: 0 12px 12px 0;
    background: rgba(123, 75, 181, .08); padding: 1rem 1.15rem;
}
.page-hp-spell-picker .wcs-callout p { margin: 0; }

/* a two-up split for the "what it is not" pair */
.page-hp-spell-picker .wcs-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.4rem; }
.page-hp-spell-picker .wcs-pair-card {
    background: var(--wcs-surface); border: 1px solid var(--wcs-border); border-radius: 12px;
    padding: 1rem 1.1rem; border-top: 3px solid var(--wcs-accent);
}
.page-hp-spell-picker .wcs-pair-card h3 { margin-top: 0 !important; font-size: 1.02rem !important; }
.page-hp-spell-picker .wcs-pair-card p:last-child { margin-bottom: 0; font-size: .9rem; }

@media (max-width: 767.98px) {
    .page-hp-spell-picker .wcs-pair { grid-template-columns: 1fr; }
    .page-hp-spell-picker .wcs-content { padding: 2.5rem 0 2.75rem; }
    .page-hp-spell-picker .wcs-row { grid-template-columns: 40px 1fr; gap: .75rem; }
}
