/* ==========================================================================
   HP Location Picker — the Floo Network (Harry Potter category)
   Only page on floo-network-engine.js. A stone hearth seen head-on: throw the
   Floo powder, the flames turn emerald green and roar, a strip of grates (one
   wizarding place each) rushes past first-person and decelerates, and you step
   out at the chosen location, which lights up and names itself.
   ⚠️ It is a first-person LINEAR rush, NOT a pointer on a loop — that is what
   keeps it from being a wheel in disguise (the hp-spell lesson).
   Page chrome is theme-aware (var(--theme-*)); the hearth, the soot and the
   green flames stay fixed — they are physical objects, not themed surfaces.
   ⚖️ Original artwork only: a generic hearth, generic flames, and one plain
   stylised silhouette per place. No reproduced designs, no likenesses.
   ========================================================================== */
.page-hp-location-picker {
    --flo-primary: #2f7a52;
    --flo-accent: #6ff09a;
    --flo-grad: linear-gradient(135deg, #6ff09a, #1f7a44);
    --flo-ink: var(--theme-text, #1f2430);
    /* ⚠️ --theme-muted, NOT --theme-text-muted — the latter is undefined and
       silently falls back to its literal on every theme. */
    --flo-muted: var(--theme-muted, #6b7280);
    --flo-surface: var(--theme-surface, #ffffff);
    --flo-border: var(--theme-border, #e5e7eb);
    --flo-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 */
    --flo-plate: #efe6d0;
}

/* ---- Ambient backdrop --------------------------------------------------- */
.page-hp-location-picker::before {
    content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
    background:
        radial-gradient(1040px 560px at 6% -6%, rgba(47, 122, 82, 0.18), transparent 60%),
        radial-gradient(920px 520px at 96% 4%, rgba(111, 240, 154, 0.10), transparent 62%),
        radial-gradient(880px 620px at 50% 108%, rgba(12, 26, 16, 0.14), transparent 60%);
}

/* ---- Stage -------------------------------------------------------------- */
.page-hp-location-picker .flo-stage { position: relative; max-width: 600px; margin: 0 auto; }
.page-hp-location-picker .flo-stage-wrap { position: relative; }
.page-hp-location-picker #floStage { display: block; }
.page-hp-location-picker .flo-svg {
    width: 100%; height: auto; display: block; max-height: 72vh; border-radius: 16px;
    filter: drop-shadow(0 14px 34px rgba(8, 18, 10, .55));
}
.page-hp-location-picker .flo-fx,
.page-hp-location-picker .flo-flames,
.page-hp-location-picker .flo-plate { pointer-events: none; }

/* ---- Grate cells -------------------------------------------------------- */
.page-hp-location-picker .flo-cell-emblem { transition: filter .3s ease; }
.page-hp-location-picker .flo-cell.is-winner .flo-cell-emblem { filter: drop-shadow(0 0 12px rgba(111, 240, 154, .95)); }
.page-hp-location-picker .flo-cell.is-winner .flo-cell-glow { opacity: .5 !important; }

/* ---- Floo flames --------------------------------------------------------
   ⭐ THE FIRE STARTS ORANGE (an ordinary hearth) and turns GREEN only once the
   Floo powder is thrown — that colour change IS the magic beat. Colour is
   driven here by state class (CSS `fill` overrides the SVG fill attribute), so
   the engine only toggles is-normal / is-roar / is-travel / is-settle. */
.page-hp-location-picker .flo-flame { transform-box: fill-box; transform-origin: center bottom; transition: fill .18s ease; }
/* base = a normal orange fire */
.page-hp-location-picker .flo-flame-a,
.page-hp-location-picker .flo-flame-b { fill: #b5521c; }
.page-hp-location-picker .flo-flame-c { fill: #ff8a2a; }
.page-hp-location-picker .flo-flame-core { fill: #ffe6a6; }
/* …turned emerald once the powder catches */
.page-hp-location-picker .flo-flames.is-roar .flo-flame-a,
.page-hp-location-picker .flo-flames.is-roar .flo-flame-b,
.page-hp-location-picker .flo-flames.is-travel .flo-flame-a,
.page-hp-location-picker .flo-flames.is-travel .flo-flame-b,
.page-hp-location-picker .flo-flames.is-settle .flo-flame-a,
.page-hp-location-picker .flo-flames.is-settle .flo-flame-b { fill: #2fae54; }
.page-hp-location-picker .flo-flames.is-roar .flo-flame-c,
.page-hp-location-picker .flo-flames.is-travel .flo-flame-c,
.page-hp-location-picker .flo-flames.is-settle .flo-flame-c { fill: #6ff09a; }
.page-hp-location-picker .flo-flames.is-roar .flo-flame-core,
.page-hp-location-picker .flo-flames.is-travel .flo-flame-core,
.page-hp-location-picker .flo-flames.is-settle .flo-flame-core { fill: #daffe6; }

/* size/motion per state */
.page-hp-location-picker .flo-flames.is-normal .flo-flame { animation: floFlicker 1.7s ease-in-out infinite; opacity: .72; transform: scaleY(.8); }
.page-hp-location-picker .flo-flames.is-normal .flo-flame-b { animation-delay: -.5s; }
.page-hp-location-picker .flo-flames.is-normal .flo-flame-c { animation-delay: -.9s; }
.page-hp-location-picker .flo-flames.is-normal .flo-flame-core { animation-delay: -1.2s; }
.page-hp-location-picker .flo-flames.is-roar .flo-flame { animation: floRoar .5s ease-in-out infinite; opacity: 1; }
.page-hp-location-picker .flo-flames.is-roar .flo-flame-b { animation-delay: -.16s; }
.page-hp-location-picker .flo-flames.is-roar .flo-flame-c { animation-delay: -.3s; }
.page-hp-location-picker .flo-flames.is-travel .flo-flame { animation: floFlicker .9s ease-in-out infinite; opacity: .9; }
.page-hp-location-picker .flo-flames.is-travel .flo-flame-b { animation-delay: -.3s; }
.page-hp-location-picker .flo-flames.is-travel .flo-flame-c { animation-delay: -.5s; }
.page-hp-location-picker .flo-flames.is-settle .flo-flame { animation: floFlicker 1.9s ease-in-out infinite; opacity: .5; transform: scaleY(.7); }
@keyframes floFlicker {
    0%, 100% { transform: scaleY(1) scaleX(1); }
    50% { transform: scaleY(1.12) scaleX(.94); }
}
@keyframes floRoar {
    0%, 100% { transform: scaleY(1.15) scaleX(1.05); }
    50% { transform: scaleY(1.4) scaleX(.9); }
}
.page-hp-location-picker .flo-flash { mix-blend-mode: screen; }
.page-hp-location-picker .flo-fx-ember,
.page-hp-location-picker .flo-fx-powder { mix-blend-mode: screen; }

@media (prefers-reduced-motion: reduce) {
    .page-hp-location-picker .flo-flame { animation: none !important; }
}

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

/* ---- Start overlay ------------------------------------------------------ */
.page-hp-location-picker .flo-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.02rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
    color: #082414; background: var(--flo-grad); cursor: pointer; box-shadow: 0 12px 30px -8px rgba(10, 40, 22, .95);
    animation: floStartPulse 1.8s ease-in-out infinite;
}
.page-hp-location-picker .flo-start-overlay:hover { filter: brightness(1.08); }
.page-hp-location-picker .flo-start-overlay[hidden] { display: none; }
@keyframes floStartPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}

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

/* ---- Result bar --------------------------------------------------------- */
.page-hp-location-picker .wsp-result {
    --wsp-result-accent: var(--flo-primary);
    --wsp-result-grad: var(--flo-grad);
    --wsp-result-btn-ink: #082414;
    --wsp-result-plate: var(--flo-plate);
    --wsp-result-display: var(--flo-display);
    --wsp-result-tint: linear-gradient(135deg, rgba(111, 240, 154, .13), rgba(47, 122, 82, .10));
}

/* ---- Speed slider ------------------------------------------------------- */
.page-hp-location-picker .flo-speed { margin: .9rem auto .2rem; max-width: 420px; }
.page-hp-location-picker .flo-speed > label {
    display: flex; align-items: center; gap: .35rem; font-size: .85rem; font-weight: 600;
    color: var(--flo-muted); margin-bottom: .4rem;
}
.page-hp-location-picker .flo-speed-val { margin-left: auto; font-weight: 800; color: var(--flo-primary); font-variant-numeric: tabular-nums; }
.page-hp-location-picker .flo-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-location-picker .flo-range::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%;
    background: var(--flo-grad); border: 2px solid #fff; box-shadow: 0 2px 6px -1px rgba(10, 40, 22, .8);
}
.page-hp-location-picker .flo-range::-moz-range-thumb {
    width: 18px; height: 18px; border-radius: 50%; background: #2f7a52; border: 2px solid #fff;
}
.page-hp-location-picker .flo-range-ends {
    display: flex; justify-content: space-between; font-size: .72rem; color: var(--flo-muted);
    opacity: .75; margin-top: .25rem;
}

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

/* ---- Place chooser grid (settings) -------------------------------------- */
.page-hp-location-picker .flo-item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .5rem; }
.page-hp-location-picker .flo-chip {
    --chip-c: #2f7a52; position: relative;
    border: 2px solid var(--flo-border); background: var(--flo-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-location-picker .flo-chip img,
.page-hp-location-picker .flo-chip-ink {
    width: 58px; height: 58px; display: block; margin: 0 auto .25rem; object-fit: contain;
    background: var(--flo-plate); border-radius: 50%; padding: 5px;
    box-shadow: inset 0 0 0 1.5px rgba(47, 122, 82, .45);
}
.page-hp-location-picker .flo-chip-ink svg { width: 100%; height: 100%; display: block; }
.page-hp-location-picker .flo-chip-t { font-size: .68rem; font-weight: 700; color: var(--flo-ink); display: block; line-height: 1.15; }
.page-hp-location-picker .flo-chip:hover { transform: translateY(-2px); border-color: var(--chip-c); }
.page-hp-location-picker .flo-chip.is-on { opacity: 1; border-color: var(--chip-c); box-shadow: 0 6px 16px -10px var(--chip-c); }
.page-hp-location-picker .flo-chip.is-custom { opacity: 1; border-style: dashed; border-color: var(--chip-c); }
.page-hp-location-picker .flo-chip-x {
    position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; border-radius: 50%;
    background: var(--flo-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-location-picker .flo-custom-row { display: flex; gap: .4rem; margin-top: .6rem; }
.page-hp-location-picker .flo-custom-row input {
    flex: 1 1 auto; border: 1px solid var(--flo-border); border-radius: 10px; padding: .5rem .7rem; font-size: .9rem;
    background: var(--flo-surface); color: var(--flo-ink);
}
.page-hp-location-picker .flo-custom-row button { border: 0; border-radius: 10px; padding: .5rem .9rem; font-weight: 700; color: #082414; background: var(--flo-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-location-picker .flo-content {
    color: var(--flo-ink);
    background: linear-gradient(180deg, #ffffff 0%, #f2f8f4 100%);
    padding: 3.5rem 0 3.75rem; margin-top: 1rem;
    border-top: 1px solid var(--flo-border);
}
body[data-theme].page-hp-location-picker .flo-content { background: var(--theme-bg); }
.page-hp-location-picker .flo-inner { max-width: 860px; margin: 0 auto; padding: 0 1rem; }
.page-hp-location-picker .flo-content h2,
.page-hp-location-picker .flo-content h3 { color: var(--flo-ink); }
.page-hp-location-picker .flo-content p,
.page-hp-location-picker .flo-content li { color: var(--flo-muted); }
.page-hp-location-picker .flo-content strong { color: var(--flo-ink); }
.page-hp-location-picker .flo-content em { color: var(--flo-ink); font-style: italic; }
.page-hp-location-picker .flo-content a { color: var(--flo-primary); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.page-hp-location-picker .flo-content a:hover { color: #1f5637; }

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

/* ---- Signature section shape: a MAP-STOPS itinerary, distinct from the
   spell page's numbered ledger and the professor page's card deck. --------- */
.page-hp-location-picker .flo-stops { margin-top: 1.4rem; position: relative; padding-left: 8px; }
.page-hp-location-picker .flo-stop {
    display: grid; grid-template-columns: 30px 1fr; gap: 1rem; align-items: start;
    padding: 0 0 1.4rem; position: relative;
}
.page-hp-location-picker .flo-stop::before {
    content: ""; position: absolute; left: 14px; top: 26px; bottom: -6px; width: 2px; background: var(--flo-border);
}
.page-hp-location-picker .flo-stop:last-child::before { display: none; }
.page-hp-location-picker .flo-stop-dot {
    width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
    background: var(--flo-grad); color: #082414; z-index: 1;
}
.page-hp-location-picker .flo-stop-dot i { font-size: .85rem; }
.page-hp-location-picker .flo-stop h3 { margin: 2px 0 .2rem !important; font-size: 1.05rem !important; }
.page-hp-location-picker .flo-stop p { margin: 0; font-size: .95rem; }

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

.page-hp-location-picker .flo-callout {
    margin-top: 1.4rem; border-left: 4px solid var(--flo-primary); border-radius: 0 12px 12px 0;
    background: rgba(47, 122, 82, .08); padding: 1rem 1.15rem;
}
.page-hp-location-picker .flo-callout p { margin: 0; }

.page-hp-location-picker .flo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.4rem; }
.page-hp-location-picker .flo-pair-card {
    background: var(--flo-surface); border: 1px solid var(--flo-border); border-radius: 12px;
    padding: 1rem 1.1rem; border-top: 3px solid var(--flo-accent);
}
.page-hp-location-picker .flo-pair-card h3 { margin-top: 0 !important; font-size: 1.02rem !important; }
.page-hp-location-picker .flo-pair-card p:last-child { margin-bottom: 0; font-size: .9rem; }

@media (max-width: 767.98px) {
    .page-hp-location-picker .flo-pair { grid-template-columns: 1fr; }
    .page-hp-location-picker .flo-content { padding: 2.5rem 0 2.75rem; }
}
