/* Islamic History Adventure: the explorer's hero with its scene cards, the era and map controls, the drawn map with
   clay pins and dotted journeys, the place panel, the timeline strip, the fact card album and timeline game, and each
   exploration's page (scene, fact cards, map, puzzle). Maps are geography and stay left to right; everything else uses
   logical properties so Arabic and Urdu mirror. Motion stops for reduced motion. */

.page-history {
    --hx-paper: #FFF9EE;
    --hx-paper-2: #FBEBD0;
    --hx-edge: rgba(150, 100, 40, .22);
    --hx-ink: #3B2C1E;
    --hx-sea-a: #8ED0F5;
    --hx-sea-b: #5BAEE6;
    --hx-land-a: #FBE7BF;
    --hx-land-b: #EFCB8C;
    --hx-coast: #C99A5B;
    --hx-water: #73BFEF;
    --hx-river: #59A9E3;
    --hx-peak: #C08A5C;
    --hx-dune: #D9A562;
    --hx-label: #6B4E2E;
    --hx-sea-label: #FFFFFF;
    --hx-route: #E0503F;
    --hx-pin: #FFFFFF;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .page-history {
        --hx-paper: #2F2A6E; --hx-paper-2: #29245F; --hx-edge: rgba(255, 255, 255, .14); --hx-ink: #FFF7EE;
        --hx-sea-a: #263F86; --hx-sea-b: #1C2F6B; --hx-land-a: #5A4E9E; --hx-land-b: #463D8A; --hx-coast: #8D80D6;
        --hx-water: #2C4C98; --hx-river: #5C8FE0; --hx-peak: #8E7FD6; --hx-dune: #7A6CC2; --hx-label: #F3E9FF;
        --hx-sea-label: #BFD4FF; --hx-route: #FF9F8E; --hx-pin: #3E3592;
    }
}
:root[data-theme="dark"] .page-history {
    --hx-paper: #2F2A6E; --hx-paper-2: #29245F; --hx-edge: rgba(255, 255, 255, .14); --hx-ink: #FFF7EE;
    --hx-sea-a: #263F86; --hx-sea-b: #1C2F6B; --hx-land-a: #5A4E9E; --hx-land-b: #463D8A; --hx-coast: #8D80D6;
    --hx-water: #2C4C98; --hx-river: #5C8FE0; --hx-peak: #8E7FD6; --hx-dune: #7A6CC2; --hx-label: #F3E9FF;
    --hx-sea-label: #BFD4FF; --hx-route: #FF9F8E; --hx-pin: #3E3592;
}

.hx-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.hx-visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hx-scene-art { display: block; width: 100%; height: 100%; }
.hx-status { text-align: center; color: var(--ink-soft); font-weight: 700; margin: 18px 0; }
.hx-status--error { color: var(--coral-deep); }
.hx[data-state="ready"] [data-state-loading] { display: none; }

/* ---------- Hero ---------- */
.hx-hero {
    display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(18px, 3vw, 40px); align-items: center;
    padding: clamp(18px, 3vw, 34px); margin-block-end: 18px; border-radius: var(--radius-l);
    background:
        radial-gradient(600px 300px at 100% 0%, rgba(255, 200, 74, .28), transparent 70%),
        radial-gradient(500px 260px at 0% 100%, rgba(79, 168, 238, .2), transparent 70%),
        linear-gradient(160deg, var(--hx-paper), var(--hx-paper-2));
    box-shadow: inset 0 0 0 1.5px var(--hx-edge), var(--shadow);
    position: relative; overflow: hidden; isolation: isolate;
}
.hx-hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
    background-image: radial-gradient(circle at 1px 1px, rgba(150, 100, 40, .16) 1px, transparent 0);
    background-size: 18px 18px;
}
.hx-kicker {
    display: inline-flex; align-items: center; gap: 8px; padding-block: 6px 6px; padding-inline: 8px 14px; border-radius: 999px;
    background: var(--grape-soft); color: var(--grape-deep); font-weight: 800; text-decoration: none; font-size: .95rem;
}
:root[data-theme="dark"] .hx-kicker { color: var(--ink); }
.hx-kicker .k-ico { width: 26px; height: 26px; }
.hx-hero h1 { font-family: var(--font-display); font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.02; margin: 12px 0 8px; color: var(--hx-ink); letter-spacing: -.01em; }
.hx-hero-intro { font-family: var(--font-read); font-size: 1.08rem; line-height: 1.55; color: var(--ink-soft); margin: 0 0 12px; max-width: 58ch; }
.hx-guide { margin-block: 6px 14px; }
.hx-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; list-style: none; margin: 0; padding: 0; }
.hx-stat {
    display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 20px;
    background: var(--glass-strong); box-shadow: inset 0 0 0 1.5px var(--glass-edge), var(--shadow-s);
}
.hx-stat b { font-family: var(--font-display); font-size: 1.7rem; line-height: 1; color: var(--hx-ink); }
.hx-stat small { font-size: .9rem; color: var(--ink-faint); }
.hx-stat > span { font-size: .85rem; font-weight: 700; color: var(--ink-soft); }
.hx-stat--places b { color: var(--sun-deep); }
.hx-stat--cards b { color: var(--grape-deep); }
.hx-stat--puzzles b { color: var(--mint-deep); }
:root[data-theme="dark"] .hx-stat b { color: var(--ink); }

.hx-hero-art { position: relative; min-height: 340px; }
.hx-hero-scroll { position: relative; height: 100%; min-height: 340px; }
.hx-polaroid {
    position: absolute; margin: 0; width: 58%; padding: 8px 8px 10px; border-radius: 18px; background: #FFFDF8;
    box-shadow: 0 22px 40px -24px rgba(60, 30, 10, .7), 0 2px 6px rgba(60, 30, 10, .12);
    transform: rotate(var(--r)); transition: transform .4s var(--ease-bounce);
}
.hx-polaroid svg { border-radius: 12px; aspect-ratio: 16 / 9; height: auto; }
.hx-polaroid figcaption { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; padding: 6px 4px 0; color: #4A3B2B; }
.hx-polaroid figcaption b { font-family: var(--font-display); font-size: .98rem; line-height: 1.15; }
.hx-polaroid figcaption small { font-weight: 800; color: #B0723F; white-space: nowrap; }
.hx-polaroid--kaaba { --r: -6deg; inset-inline-start: 0; top: 0; z-index: 1; }
.hx-polaroid--jerusalem { --r: 5deg; inset-inline-end: 0; top: 10%; z-index: 2; }
.hx-polaroid--timbuktu { --r: -2deg; inset-inline-start: 30%; bottom: 0; z-index: 3; }
.hx-hero-art:hover .hx-polaroid { transform: rotate(0) translateY(-4px); }
.hx-hero-compass { position: absolute; width: 80px; inset-inline-end: 1%; bottom: 2%; z-index: 4; filter: drop-shadow(0 8px 12px rgba(60, 30, 10, .3)); }
.hx-hero-compass circle { fill: #FFF6E2; stroke: #C99A5B; stroke-width: 3; }
.hx-hero-compass .hx-hero-compass-ring { fill: none; stroke-dasharray: 2 5; }
.hx-hero-compass path { fill: #6B4E2E; }
.hx-hero-compass .hx-hero-compass-n { fill: #E0503F; }

/* ---------- Toolbar: eras and maps ---------- */
.hx-toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-block-end: 12px; }
.hx-eras { display: flex; flex-wrap: wrap; gap: 8px; }
.hx-era {
    --t: var(--grape); --td: var(--grape-deep); --ts: var(--grape-soft);
    display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0; min-height: 52px; padding: 7px 16px;
    border: 0; border-radius: 18px; cursor: pointer; font: inherit; text-align: start; color: var(--ink);
    background: var(--glass-strong); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--t) 30%, transparent), var(--shadow-s);
    transition: transform .2s var(--ease-bounce), background .2s;
}
.hx-era--all { flex-direction: row; align-items: center; gap: 6px; font-weight: 800; }
.hx-era--all .k-ico { width: 22px; height: 22px; color: var(--sun-deep); }
.hx-era-name { font-family: var(--font-display); font-weight: 600; font-size: 1rem; line-height: 1.1; }
.hx-era small { font-size: .78rem; font-weight: 700; color: var(--ink-faint); }
.hx-era:hover { transform: translateY(-2px); }
.hx-era[aria-pressed="true"] { background: linear-gradient(180deg, color-mix(in srgb, var(--t) 70%, #fff), var(--t)); color: #fff; box-shadow: inset 0 -3px 0 var(--td), var(--shadow-s); }
.hx-era[aria-pressed="true"] small { color: rgba(255, 255, 255, .9); }
.c-sun.hx-era[aria-pressed="true"], .hx-era--all[aria-pressed="true"] { color: #3B2C1E; }
.c-sun.hx-era[aria-pressed="true"] small { color: #5A4630; }
.hx-era--all[aria-pressed="true"] { background: linear-gradient(180deg, #FFE69A, #FFC84A); box-shadow: inset 0 -3px 0 #E39E00, var(--shadow-s); }
.hx-maptabs { display: inline-flex; gap: 4px; padding: 5px; border-radius: 999px; background: var(--glass-strong); box-shadow: inset 0 0 0 1.5px var(--glass-edge), var(--shadow-s); }
.hx-maptab {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 16px; border: 0; border-radius: 999px;
    background: transparent; color: var(--ink-soft); font: inherit; font-weight: 800; cursor: pointer;
}
.hx-maptab .k-ico { width: 22px; height: 22px; }
.hx-maptab[aria-selected="true"] { background: linear-gradient(180deg, #A58CFF, #7A5CF0); color: #fff; box-shadow: inset 0 -3px 0 rgba(40, 10, 120, .25); }

/* ---------- Stage: the map and its place panel ---------- */
.hx-stage { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.hx-mapwrap {
    padding: 10px; border-radius: var(--radius-l);
    background: linear-gradient(160deg, #F4E2BF, #E6C891);
    box-shadow: inset 0 0 0 2px rgba(150, 100, 40, .25), var(--shadow);
}
:root[data-theme="dark"] .hx-mapwrap { background: linear-gradient(160deg, #3A3384, #2B2670); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hx-mapwrap { background: linear-gradient(160deg, #3A3384, #2B2670); } }
.hx-mapscroll { overflow-x: auto; overscroll-behavior-x: contain; border-radius: 24px; scrollbar-width: thin; }
.hx-map {
    position: relative; margin: 0; width: 100%; aspect-ratio: var(--ar); border-radius: 24px; overflow: hidden;
    background: var(--hx-sea-b); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .06);
}
.hx-map--world.hx-map--hub { min-width: 720px; }
.hx-map--hijaz.hx-map--hub { max-width: 640px; margin-inline: auto; }
.hx-map-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hx-sea { fill: var(--hx-sea-a); }
.hx-land { stroke: none; }
.hx-coast { fill: none; stroke: var(--hx-coast); stroke-width: 2.4; stroke-linejoin: round; opacity: .8; }
.hx-water { fill: var(--hx-water); stroke: var(--hx-coast); stroke-width: 2; }
.hx-river { fill: none; stroke: var(--hx-river); stroke-width: 3.2; stroke-linecap: round; opacity: .85; }
.hx-dunes path { fill: none; stroke: var(--hx-dune); stroke-width: 2.4; stroke-linecap: round; opacity: .75; }
.hx-peaks path { fill: var(--hx-peak); opacity: .85; }
.hx-peaks .hx-peak-snow { fill: #FFF6E8; opacity: .9; }
.hx-lbl text { font-family: var(--font-display); font-weight: 600; fill: var(--hx-label); paint-order: stroke; stroke: rgba(255, 249, 238, .7); stroke-width: 4px; stroke-linejoin: round; }
.hx-lbl--sea text { fill: var(--hx-sea-label); stroke: rgba(30, 90, 160, .35); font-style: italic; font-size: 19px; letter-spacing: .06em; }
.hx-lbl--land text { font-size: 22px; letter-spacing: .14em; text-transform: uppercase; opacity: .55; stroke-width: 0; }
.hx-lbl--town text { font-size: 17px; }
.hx-lbl--town circle { fill: var(--hx-label); }
.hx-map--hijaz .hx-lbl--sea text { font-size: 30px; }
.hx-map--hijaz .hx-lbl--land text { font-size: 26px; }
.hx-map--hijaz .hx-lbl--town text { font-size: 24px; }
:root[data-theme="dark"] .hx-lbl text { stroke: rgba(30, 26, 78, .6); }
.hx-route { fill: none; stroke: var(--hx-route); stroke-width: 3.4; stroke-dasharray: 2 9; stroke-linecap: round; opacity: .9; animation: hx-march 1.4s linear infinite; }
.hx-map--hijaz .hx-route { stroke-width: 6; stroke-dasharray: 3 14; }
.hx-route.is-secret { opacity: 0; }
.hx-route.is-drawn { opacity: 1; }
@keyframes hx-march { to { stroke-dashoffset: -22; } }
.hx-inset-box { fill: rgba(255, 255, 255, .14); stroke: #7A5CF0; stroke-width: 2.5; stroke-dasharray: 6 5; }
.hx-compass circle { fill: rgba(255, 249, 238, .85); stroke: var(--hx-coast); stroke-width: 2; }
.hx-compass-needle { fill: #6B4E2E; }
.hx-compass-north { fill: #E0503F; }
.hx-compass text { font: 700 16px var(--font-display); fill: #6B4E2E; }
.hx-map--hijaz .hx-compass { transform-box: fill-box; }

.hx-inset-btn {
    position: absolute; inset-inline-start: var(--x); top: var(--y); width: var(--w); height: var(--h);
    border: 0; padding: 0; background: transparent; cursor: zoom-in; border-radius: 10px;
}
.hx-inset-btn:focus-visible { outline: 3px solid #7A5CF0; outline-offset: 2px; }
.hx-inset-tag {
    position: absolute; inset-inline-end: calc(100% + 4px); bottom: 0; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 4px; padding-block: 3px 3px; padding-inline: 6px 10px; border-radius: 999px; font-size: .75rem; font-weight: 800;
    background: #7A5CF0; color: #fff; box-shadow: 0 6px 12px -6px rgba(60, 30, 140, .8);
}
.hx-inset-tag .k-ico { width: 16px; height: 16px; }

/* Pins: clay buttons laid on the drawn map. */
.hx-pin {
    position: absolute; inset-inline-start: var(--x); top: var(--y); z-index: 2;
    display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer;
    --pd: 42px;
    transform: translate(-50%, -50%); font: inherit; color: var(--hx-ink); -webkit-tap-highlight-color: transparent;
}
.hx-map--world { --pd-world: 34px; }
.hx-map--world .hx-pin { --pd: var(--pd-world); }
.hx-pin--end { flex-direction: row; transform: translate(calc(var(--pd) / -2), -50%); }
.hx-pin--start { flex-direction: row-reverse; transform: translate(calc(-100% + var(--pd) / 2), -50%); }
.hx-pin--top { flex-direction: column-reverse; gap: 3px; transform: translate(-50%, calc(-100% + var(--pd) / 2)); }
.hx-pin--bottom { flex-direction: column; gap: 3px; transform: translate(-50%, calc(var(--pd) / -2)); }
.hx-pin-dot {
    position: relative; display: grid; place-items: center; width: var(--pd); height: var(--pd); flex: none; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff, var(--hx-pin) 60%);
    box-shadow: 0 0 0 3px #E0503F, 0 8px 14px -6px rgba(90, 30, 20, .7);
    transition: transform .25s var(--ease-bounce);
}
.hx-pin-dot .k-ico { width: calc(var(--pd) * .6); height: calc(var(--pd) * .6); }
.hx-pin-dot::after {
    content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid rgba(224, 80, 63, .5);
    animation: hx-ping 2.4s ease-out infinite; pointer-events: none;
}
@keyframes hx-ping { 0% { transform: scale(.7); opacity: 1; } 80%, 100% { transform: scale(1.35); opacity: 0; } }
.hx-pin-name {
    padding: 3px 10px; border-radius: 999px; font-weight: 800; font-size: .86rem; white-space: nowrap;
    background: rgba(255, 252, 244, .94); color: #3B2C1E; box-shadow: 0 4px 10px -6px rgba(60, 30, 10, .5);
}
.hx-pin-count {
    position: absolute; top: -7px; inset-inline-end: -9px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
    display: grid; place-items: center; font-size: .72rem; font-weight: 900; color: #fff; background: #7A5CF0; box-shadow: 0 0 0 2px #fff;
}

.hx-pin-done { position: absolute; top: -7px; inset-inline-start: -9px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: .7rem; font-weight: 900; color: #fff; background: var(--mint-deep); box-shadow: 0 0 0 2px #fff; }
.hx-pin:hover .hx-pin-dot, .hx-pin.is-open .hx-pin-dot { transform: scale(1.12); }
.hx-pin.is-open .hx-pin-dot { box-shadow: 0 0 0 4px #7A5CF0, 0 10px 18px -6px rgba(60, 30, 140, .8); }
.hx-pin:focus-visible { outline: none; }
.hx-pin:focus-visible .hx-pin-dot { outline: 3px solid #7A5CF0; outline-offset: 3px; }
.hx-pin.is-dim { opacity: .28; filter: grayscale(.8); }
.hx-pin--stop { cursor: default; z-index: 1; }
.hx-pin--stop { --pd: 16px; }
.hx-pin--stop .hx-pin-dot { width: 16px; height: 16px; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--hx-route); background: var(--hx-route); }
.hx-pin--stop .hx-pin-dot::after { display: none; }
.hx-pin--stop .hx-pin-name { font-size: .78rem; padding: 2px 8px; }
.hx-pin--context { --pd: 12px; }
.hx-pin--context .hx-pin-dot { width: 12px; height: 12px; background: #FFF9EE; box-shadow: 0 0 0 2px #B0723F, 0 3px 6px -3px rgba(60, 30, 10, .6); }
.hx-pin--context .hx-pin-name { font-size: .72rem; padding: 1px 7px; opacity: .9; }
.hx-map--world.hx-map--page .hx-pin--context .hx-pin-name { display: none; }
.hx-pin--here .hx-pin-dot { box-shadow: 0 0 0 4px var(--sun-deep), 0 10px 18px -6px rgba(120, 70, 0, .7); }
.hx-pin--choice .hx-pin-dot, .hx-pin--stop-btn .hx-pin-dot { box-shadow: 0 0 0 3px #7A5CF0, 0 8px 14px -6px rgba(60, 30, 140, .7); }
.hx-pin--choice .hx-pin-dot b { font-family: var(--font-display); font-size: 1.3rem; color: #5B3FD0; }
.hx-pin--choice .hx-pin-dot::after, .hx-pin--stop-btn .hx-pin-dot::after { border-color: rgba(122, 92, 240, .55); }
.hx-pin--stop-btn .hx-pin-dot b { position: absolute; top: -8px; inset-inline-end: -8px; min-width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; font-size: .78rem; color: #fff; background: var(--mint-deep); }
.hx-pin--stop-btn .hx-pin-dot b:empty { display: none; }
.hx-pin.is-right .hx-pin-dot { box-shadow: 0 0 0 4px var(--mint), 0 0 0 9px rgba(63, 191, 155, .3); }
.hx-pin.is-wrong .hx-pin-dot { box-shadow: 0 0 0 4px var(--coral); animation: hx-shake .4s; }
@keyframes hx-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.hx-map-note { position: absolute; inset-inline-start: 12px; bottom: 8px; margin: 0; padding: 2px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; color: #6B4E2E; background: rgba(255, 249, 238, .85); }
.hx-map-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 6px 2px; font-size: .85rem; color: #6B4E2E; font-weight: 700; }
:root[data-theme="dark"] .hx-map-legend { color: var(--ink-soft); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hx-map-legend { color: var(--ink-soft); } }
.hx-map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hx-legend-pin { width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px #E0503F; }
.hx-legend-route { width: 28px; height: 0; border-top: 3px dotted #E0503F; }

.hx-places { position: sticky; top: calc(var(--top-h) + 12px); }
.hx-place-default, .hx-place {
    padding: 18px; border-radius: var(--radius-l); background: var(--glass-strong);
    box-shadow: inset 0 0 0 1.5px var(--glass-edge), var(--shadow);
}
.hx-place-default-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--sun-soft); color: var(--sun-deep); }
.hx-place-default-ico .k-ico { width: 34px; height: 34px; }
.hx-place-default p { font-family: var(--font-read); color: var(--ink-soft); line-height: 1.5; }
.hx-quick { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.hx-quick-btn {
    display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding-block: 4px 4px; padding-inline: 8px 12px; border: 0; border-radius: 999px; cursor: pointer;
    font: inherit; font-weight: 700; font-size: .9rem; color: var(--ink); background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line);
}
.hx-quick-btn .k-ico { width: 22px; height: 22px; }
.hx-quick-btn small { min-width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; background: var(--grape-soft); color: var(--grape-deep); font-weight: 900; }
.hx-quick-btn.is-dim { opacity: .4; }
.hx-place-head { display: flex; align-items: center; gap: 10px; margin-block-end: 10px; }
.hx-place-head h2 { margin: 0; flex: 1; font-family: var(--font-display); font-size: 1.5rem; }
.hx-place-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: #FFE8E4; color: #E0503F; }
.hx-place-ico .k-ico { width: 30px; height: 30px; }
.hx-place-close { min-width: 46px; padding: 0; font-size: 1.5rem; }
.hx-xlist { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.hx-xcard a {
    display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px; border-radius: 20px; text-decoration: none; color: var(--ink);
    background: linear-gradient(160deg, var(--paper), var(--ts, var(--grape-soft))); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--t, var(--grape)) 25%, transparent);
    transition: transform .2s var(--ease-bounce);
}
.hx-xcard a:hover { transform: translateY(-2px); }
.hx-xcard-art { display: block; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; }
.hx-xcard-body { display: flex; flex-direction: column; gap: 2px; }
.hx-xcard-body small { font-weight: 800; color: var(--td, var(--grape-deep)); font-size: .8rem; }
:root[data-theme="dark"] .hx-xcard-body small { color: var(--ink-soft); }
.hx-xcard-body b { font-family: var(--font-display); font-weight: 600; line-height: 1.15; }
.hx-xcard.is-dim { opacity: .45; }
.hx-xcard-status { font-size: .78rem; font-weight: 800; color: var(--ink-faint); }
.hx-xcard-status.is-done { color: var(--mint-deep); }
.hx-xcard-status.is-started { color: var(--sun-deep); }

/* ---------- Timeline strip ---------- */
.hx-timeline { margin-block: 26px 10px; }
.hx-sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.hx-sec-head h2 { margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.hx-sec-head p { margin: 0; color: var(--ink-soft); font-family: var(--font-read); }
.hx-sec-head .k-ico { width: 28px; height: 28px; }
.hx-tl {
    display: grid; grid-auto-flow: column; grid-auto-columns: 178px; gap: 12px; list-style: none; margin: 12px 0 0; padding: 16px 4px 18px;
    overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; position: relative;
    background: linear-gradient(transparent 49px, color-mix(in srgb, var(--sun-deep) 45%, transparent) 49px, color-mix(in srgb, var(--sun-deep) 45%, transparent) 53px, transparent 53px);
}
.hx-tl-item { scroll-snap-align: start; transition: opacity .2s; }
.hx-tl-item.is-dim { opacity: .3; }
.hx-tl-card {
    position: relative; display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 8px 8px 10px; border-radius: 22px; text-decoration: none; color: var(--ink);
    background: linear-gradient(170deg, var(--paper), var(--ts)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--t) 28%, transparent), var(--shadow-s);
    transition: transform .2s var(--ease-bounce);
}
.hx-tl-card:hover { transform: translateY(-4px); }
.hx-tl-when {
    align-self: flex-start; padding: 3px 10px; border-radius: 999px; font-weight: 900; font-size: .8rem; color: #fff;
    background: var(--td); box-shadow: 0 0 0 3px var(--paper);
}
.c-sun .hx-tl-when { color: #3B2C1E; background: var(--sun); }
.hx-tl-art { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; }
.hx-tl-no { position: absolute; inset-inline-start: 6px; bottom: 6px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font-weight: 900; font-size: .8rem; background: rgba(255, 255, 255, .92); color: #3B2C1E; }
.hx-tl-title { font-family: var(--font-display); font-weight: 600; line-height: 1.15; font-size: 1rem; }
.hx-tl-where { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 700; color: var(--ink-soft); }
.hx-tl-where .k-ico { width: 18px; height: 18px; }

/* ---------- Album and timeline game ---------- */
.hx-bottom { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-block: 18px; }
.hx-album, .hx-play, .hx-challenge, .hx-grownups, .hx-known, .hx-x-side {
    padding: clamp(16px, 2.4vw, 24px); border-radius: var(--radius-l); background: var(--glass-strong);
    box-shadow: inset 0 0 0 1.5px var(--glass-edge), var(--shadow);
}
.hx-album h2, .hx-play h2, .hx-x-side h2, .hx-known h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-family: var(--font-display); font-size: 1.35rem; }
.hx-album h2 .k-ico, .hx-play h2 .k-ico, .hx-x-side h2 .k-ico, .hx-known h2 .k-ico { width: 28px; height: 28px; }
.hx-album-count { margin: 0 0 10px; color: var(--ink-soft); font-size: .92rem; }
.hx-album-count b { font-family: var(--font-display); font-size: 1.3rem; color: var(--grape-deep); }
:root[data-theme="dark"] .hx-album-count b { color: var(--ink); }
.hx-album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; list-style: none; margin: 0; padding: 0; }
.hx-album-slot {
    display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px 6px; border-radius: 14px; text-decoration: none; color: var(--td);
    background: color-mix(in srgb, var(--ts) 70%, var(--paper)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--t) 22%, transparent);
    filter: grayscale(.6); opacity: .75; transition: filter .3s, opacity .3s, transform .2s var(--ease-bounce);
}
:root[data-theme="dark"] .hx-album-slot { color: var(--ink); }
.hx-album-slot:hover { transform: translateY(-2px); }
.hx-album-slot.is-full { filter: none; opacity: 1; box-shadow: inset 0 0 0 2px var(--t), 0 8px 14px -10px var(--td); }
.hx-album-ico .k-ico { width: 26px; height: 26px; }
.hx-album-pips { display: flex; gap: 3px; }
.hx-album-pips i { width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 18%, transparent); }
.hx-album-pips i.is-on { background: var(--sun-deep); }
.hx-play-blurb { margin: 0 0 10px; color: var(--ink-soft); font-family: var(--font-read); }

.hx-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; list-style: none; margin: 0 0 10px; padding: 0; counter-reset: none; }
.hx-slot {
    position: relative; min-height: 74px; border-radius: 18px; padding: 6px; display: flex; align-items: stretch;
    background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--grape) 6%, transparent) 10px 20px);
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--grape) 28%, transparent);
}
.hx-slot-no { position: absolute; top: -9px; inset-inline-start: 10px; min-width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; font-weight: 900; font-size: .8rem; color: #fff; background: var(--grape); z-index: 1; }
.hx-slot .hx-card { width: 100%; }
.hx-slots--timeline { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.hx-play .hx-tray .hx-card { flex: 1 1 200px; }
.hx-tray { display: flex; flex-wrap: wrap; gap: 8px; min-height: 60px; margin-block-end: 10px; }
.hx-card {
    --t: var(--grape); --td: var(--grape-deep); --ts: var(--grape-soft);
    display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 60px; padding: 8px 12px;
    border: 0; border-radius: 16px; cursor: pointer; font: inherit; font-weight: 700; text-align: start; color: var(--ink); line-height: 1.25;
    background: linear-gradient(170deg, var(--paper), var(--ts)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--t) 30%, transparent), var(--shadow-s);
    transition: transform .2s var(--ease-bounce);
}
.hx-card:hover { transform: translateY(-2px); }
.hx-card .k-ico { width: 22px; height: 22px; color: var(--td); }
.hx-card small { font-weight: 800; color: var(--td); font-size: .8rem; }
:root[data-theme="dark"] .hx-card small, :root[data-theme="dark"] .hx-card .k-ico { color: var(--ink-soft); }
.hx-card--moment { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.hx-card--moment small { width: 100%; }
.hx-card.is-right { box-shadow: inset 0 0 0 3px var(--mint), var(--shadow-s); }
.hx-card.is-wrong { box-shadow: inset 0 0 0 3px var(--coral), 0 0 0 4px rgba(255, 127, 110, .25); animation: hx-shake .4s; }
.hx-ch-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hx-ch-msg { min-height: 1.5em; margin: 8px 0 0; font-weight: 800; color: var(--grape-deep); }
:root[data-theme="dark"] .hx-ch-msg { color: var(--ink); }

/* ---------- Grown-ups ---------- */
.hx-grownups { margin-block: 18px; }
.hx-grownups h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-family: var(--font-display); }
.hx-grownups h2 .k-ico { width: 30px; height: 30px; }
.hx-grownups h3 { margin: 0 0 6px; font-size: 1rem; }
.hx-grownups-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; }
.hx-grownups p { font-family: var(--font-read); line-height: 1.55; color: var(--ink-soft); margin: 0 0 8px; }
.hx-sources { display: grid; gap: 6px; list-style: none; margin: 0 0 12px; padding: 0; }
.hx-sources li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 10px; border-radius: 14px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.hx-source-kind { font-size: .75rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); }
.hx-grownups-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }

/* ---------- An exploration ---------- */
.hx-x-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(16px, 3vw, 32px); align-items: center; margin-block-end: 18px; }
.hx-x-scene { position: relative; margin: 0; border-radius: var(--radius-l); overflow: hidden; aspect-ratio: 16 / 9; box-shadow: var(--shadow-l); isolation: isolate; }
.hx-x-scene .hx-scene-landmark { transform-origin: 50% 80%; }
.hx-artist-tag {
    position: absolute; top: 12px; inset-inline-start: 12px; display: inline-flex; align-items: center; gap: 6px; padding-block: 5px 5px; padding-inline: 8px 12px; border-radius: 999px;
    font-weight: 900; font-size: .85rem; color: #5B3FD0; background: rgba(255, 255, 255, .92); box-shadow: 0 8px 16px -10px rgba(40, 20, 100, .6);
}
.hx-artist-tag .k-ico { width: 20px; height: 20px; }
.hx-artist-note {
    position: absolute; inset-inline: 0; bottom: 0; padding: 26px 16px 12px; font-size: .88rem; line-height: 1.4; color: #fff;
    background: linear-gradient(transparent, rgba(20, 14, 50, .78)); font-family: var(--font-read);
}
.hx-artist-note b { color: #FFE69A; }
.hx-x-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; font-weight: 800; color: var(--ink-soft); font-size: .9rem; }
.hx-era-chip { padding: 4px 12px; border-radius: 999px; color: #fff; background: var(--td); }
.c-sun .hx-era-chip { color: #3B2C1E; background: var(--sun); }
.hx-x-head h1 { display: flex; align-items: center; gap: 12px; margin: 10px 0; font-family: var(--font-display); font-size: clamp(1.9rem, 3.6vw, 2.9rem); line-height: 1.05; }
.hx-x-ico { display: grid; place-items: center; width: 58px; height: 58px; flex: none; border-radius: 18px; color: var(--td); background: var(--ts); box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--t) 30%, transparent); }
:root[data-theme="dark"] .hx-x-ico { color: var(--ink); }
.hx-x-ico .k-ico { width: 38px; height: 38px; }
.hx-x-when { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.hx-x-when div { display: flex; flex-direction: column; padding: 6px 14px; border-radius: 16px; background: var(--glass-strong); box-shadow: inset 0 0 0 1.5px var(--glass-edge); }
.hx-x-when dt { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 800; color: var(--ink-faint); }
.hx-x-when dt .k-ico { width: 16px; height: 16px; }
.hx-x-when dd { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.hx-x-intro { font-family: var(--font-read); font-size: 1.12rem; line-height: 1.55; margin: 0 0 12px; }
.hx-x-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.hx-x-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-block-end: 16px; }
.hx-x-body--wide { grid-template-columns: minmax(0, 1fr); }
.hx-known .hx-sec-head p { font-size: .92rem; }
.hx-facts { display: grid; gap: 10px; list-style: none; margin: 12px 0 0; padding: 0; }
.hx-x-body--wide .hx-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hx-fact-card {
    position: relative; display: flex; flex-direction: column; gap: 6px; width: 100%; height: 100%; padding: 14px 16px; border: 0; border-radius: 22px; cursor: pointer;
    font: inherit; text-align: start; color: var(--ink);
    background: linear-gradient(165deg, #FFFDF7, #FFF3DC); box-shadow: inset 0 0 0 2px rgba(201, 154, 91, .35), 0 10px 20px -16px rgba(120, 70, 20, .7);
    transition: transform .3s var(--ease-bounce), box-shadow .3s;
}
:root[data-theme="dark"] .hx-fact-card { background: linear-gradient(165deg, #3A3384, #2E2873); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hx-fact-card { background: linear-gradient(165deg, #3A3384, #2E2873); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .12); } }
.hx-fact-card:hover { transform: translateY(-2px) rotate(-.4deg); }
.hx-fact-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hx-fact-no { font-size: .78rem; font-weight: 900; letter-spacing: .03em; color: #B0723F; text-transform: uppercase; }
.hx-fact-state { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 800; color: #5B3FD0; background: #EFE8FF; }
.hx-fact-state .k-ico { width: 18px; height: 18px; color: #C9B8FF; }
.hx-fact-text { font-family: var(--font-read); font-size: 1.04rem; line-height: 1.5; }
.hx-fact-src { font-size: .78rem; font-weight: 700; color: var(--ink-faint); }
.hx-fact-card.is-collected { box-shadow: inset 0 0 0 3px #F2B630, 0 14px 26px -16px rgba(200, 130, 0, .9); background: linear-gradient(165deg, #FFFBEA, #FFEDB8); }
:root[data-theme="dark"] .hx-fact-card.is-collected { background: linear-gradient(165deg, #4C3F7A, #3D3270); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hx-fact-card.is-collected { background: linear-gradient(165deg, #4C3F7A, #3D3270); } }
.hx-fact-card.is-collected .hx-fact-state { color: #7A4B00; background: #FFE69A; }
.hx-fact-card.is-collected .hx-fact-state .k-ico { color: #E39E00; }
.hx-fact-card.is-collected { animation: hx-collect .5s var(--ease-bounce); }
@keyframes hx-collect { 40% { transform: scale(1.04) rotate(1deg); } }
.hx-collect-msg { min-height: 1.4em; margin: 8px 0 0; font-weight: 800; color: var(--sun-deep); }
.hx-unsure {
    display: flex; gap: 12px; align-items: flex-start; margin-block-start: 10px; padding: 12px 14px; border-radius: 18px;
    background: var(--sky-soft); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--sky) 35%, transparent);
}
.hx-unsure-ico { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; font-weight: 900; font-size: 1.2rem; color: #fff; background: var(--sky-deep); }
.hx-unsure p { margin: 0; font-family: var(--font-read); line-height: 1.5; }
.hx-x-side { position: sticky; top: calc(var(--top-h) + 12px); }
.hx-x-side .hx-map { border-radius: 18px; }

/* The puzzle. */
.hx-challenge { margin-block-end: 16px; position: relative; overflow: hidden; }
.hx-challenge::before {
    content: ""; position: absolute; inset-inline-end: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 200, 74, .3), transparent 70%); pointer-events: none;
}
.hx-ch-head { display: flex; gap: 12px; align-items: flex-start; margin-block-end: 12px; }
.hx-ch-badge { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 16px; color: #fff; background: linear-gradient(180deg, #FFD66B, #F2A93B); box-shadow: inset 0 -3px 0 #C98A12; }
.hx-ch-badge .k-ico { width: 32px; height: 32px; }
.hx-ch-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.1rem; color: var(--sun-deep); text-transform: uppercase; letter-spacing: .05em; }
.hx-ch-q { margin: 2px 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.2rem, 2.2vw, 1.5rem); line-height: 1.2; }
.hx-ch-hint { margin: 0; color: var(--ink-soft); font-size: .92rem; }
.hx-ch-solved { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 999px; font-weight: 900; color: #fff; background: var(--mint-deep); white-space: nowrap; }
.hx-ch-solved .k-ico { width: 18px; height: 18px; }
.hx-quiz { display: grid; gap: 8px; margin-block-end: 10px; }
.hx-opt, .hx-mitem, .hx-sort-btn {
    min-height: 54px; padding: 10px 16px; border: 0; border-radius: 18px; cursor: pointer; font: inherit; font-weight: 700; text-align: start; color: var(--ink);
    background: var(--paper); box-shadow: inset 0 0 0 2px var(--line), var(--shadow-s); transition: transform .2s var(--ease-bounce), box-shadow .2s;
}
.hx-opt:hover:not(:disabled), .hx-mitem:hover:not(:disabled) { transform: translateY(-2px); box-shadow: inset 0 0 0 2px var(--grape), var(--shadow-s); }
.hx-opt.is-right, .hx-mitem.is-matched { box-shadow: inset 0 0 0 3px var(--mint); background: var(--mint-soft); }
.hx-opt.is-wrong, .hx-mitem.is-wrong { box-shadow: inset 0 0 0 3px var(--coral); background: var(--coral-soft); animation: hx-shake .4s; }
.hx-opt:disabled { cursor: default; }
.hx-match { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-block-end: 10px; }
.hx-match-col { display: grid; gap: 8px; align-content: start; }
.hx-mitem--a { font-family: var(--font-display); font-weight: 600; background: var(--grape-soft); }
.hx-mitem[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--grape), 0 0 0 4px rgba(141, 114, 240, .25); transform: translateY(-2px); }
.hx-mitem.is-matched { opacity: .8; }
.hx-ch-map { margin-block-end: 10px; }
.hx-ch-map .hx-map { max-width: 900px; margin-inline: auto; }
.hx-ch-map .hx-map--hijaz { max-width: 560px; }
.hx-route-log { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 10px; padding: 0; counter-reset: stop; }
.hx-route-log li { counter-increment: stop; padding: 4px 12px; border-radius: 999px; font-weight: 800; background: var(--mint-soft); }
.hx-route-log li::before { content: counter(stop) ". "; }
.hx-sort-bins { display: flex; flex-wrap: wrap; gap: 8px; margin-block-end: 8px; }
.hx-bin { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-weight: 800; font-size: .88rem; }
.hx-bin .k-ico { width: 18px; height: 18px; }
.hx-bin--known, .hx-sort-btn--known[aria-pressed="true"] { background: var(--mint-soft); color: var(--mint-deep); }
.hx-bin--tradition, .hx-sort-btn--tradition[aria-pressed="true"] { background: var(--sun-soft); color: #8A5A00; }
:root[data-theme="dark"] .hx-bin, :root[data-theme="dark"] .hx-sort-btn[aria-pressed="true"] { color: var(--ink); }
.hx-sort { display: grid; gap: 8px; list-style: none; margin: 0 0 10px; padding: 0; }
.hx-sort-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 18px; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line); }
.hx-sort-text { font-family: var(--font-read); font-weight: 700; flex: 1 1 240px; }
.hx-sort-choices { display: inline-flex; gap: 6px; }
.hx-sort-btn { min-height: 44px; padding: 6px 12px; font-size: .88rem; }
.hx-sort-btn[aria-pressed="true"] { box-shadow: inset 0 0 0 2px currentColor; }
.hx-sort-item.is-right { box-shadow: inset 0 0 0 3px var(--mint); }
.hx-sort-item.is-wrong { box-shadow: inset 0 0 0 3px var(--coral); }
.hx-pattern { position: relative; max-width: 420px; margin: 0 auto 10px; padding-top: 20px; }
.hx-pattern-arch { display: block; width: 100%; }
.hx-stones { position: absolute; inset: 20px 0 auto; aspect-ratio: 400 / 230; list-style: none; margin: 0; padding: 0; }
.hx-stone-slot { position: absolute; inset-inline-start: var(--x); top: var(--y); width: 0; height: 0; transform: rotate(var(--a)); }
.hx-stone {
    display: block; width: 38px; height: 50px; margin-inline-start: -19px; margin-top: -25px; border: 0; padding: 0; border-radius: 8px 8px 4px 4px;
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .12), 0 4px 8px -4px rgba(0, 0, 0, .4);
}
.hx-stone.is-red { background: linear-gradient(180deg, #E0604F, #B83A2C); }
.hx-stone.is-white { background: linear-gradient(180deg, #FFFFFF, #F1E6D2); }
.hx-stone.is-empty { background: repeating-linear-gradient(45deg, #FFF8EC 0 6px, #EFE3CC 6px 12px); box-shadow: inset 0 0 0 2px #C99A5B; cursor: pointer; animation: hx-glow 1.6s ease-in-out infinite; }
button.hx-stone { cursor: pointer; }
.hx-stone.is-wrong { box-shadow: inset 0 0 0 3px var(--coral), 0 0 0 4px rgba(255, 127, 110, .4); }
@keyframes hx-glow { 50% { box-shadow: inset 0 0 0 2px #C99A5B, 0 0 0 5px rgba(255, 200, 74, .45); } }
.hx-pattern-key { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 4px 0 0; font-weight: 700; font-size: .88rem; color: var(--ink-soft); }
.hx-pattern-key .hx-stone { display: inline-block; width: 16px; height: 20px; margin: 0; border-radius: 4px; }
.hx-challenge.is-solved { box-shadow: inset 0 0 0 3px var(--mint), var(--shadow); }

.hx-x-nav { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; margin-block: 8px 16px; }
.hx-x-nav-link {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 20px; text-decoration: none; color: var(--ink);
    background: var(--glass-strong); box-shadow: inset 0 0 0 1.5px var(--glass-edge), var(--shadow-s); transition: transform .2s var(--ease-bounce);
}
.hx-x-nav-link:hover { transform: translateY(-2px); }
.hx-x-nav-link span { display: flex; flex-direction: column; min-width: 0; }
.hx-x-nav-link small { font-weight: 800; color: var(--ink-faint); font-size: .78rem; }
.hx-x-nav-link b { font-family: var(--font-display); font-weight: 600; line-height: 1.15; }
.hx-x-nav-link--prev { grid-column: 1; }
.hx-x-nav-map { grid-column: 2; }
.hx-x-nav-link--next { grid-column: 3; justify-content: flex-end; text-align: end; }
.hx-chev { width: 24px; height: 24px; flex: none; }

/* ---------- Narrow screens ---------- */
@media (max-width: 1100px) {
    .hx-stage { grid-template-columns: minmax(0, 1fr) 290px; }
}
@media (max-width: 900px) {
    .hx-hero, .hx-x-hero { grid-template-columns: minmax(0, 1fr); }
    .hx-hero-art { min-height: 250px; }
    .hx-stage { grid-template-columns: minmax(0, 1fr); }
    .hx-places, .hx-x-side { position: static; }
    .hx-bottom, .hx-grownups-grid, .hx-x-body { grid-template-columns: minmax(0, 1fr); }
    .hx-x-body--wide .hx-facts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
    .hx-stats { gap: 6px; }
    .hx-stat { padding: 8px 10px; }
    .hx-stat b { font-size: 1.35rem; }
    .hx-polaroid { width: 70%; }
    .hx-polaroid--timbuktu { inset-inline-start: 8%; }
    .hx-hero-compass { width: 64px; }
    .hx-toolbar { flex-direction: column; align-items: stretch; }
    .hx-maptabs { align-self: flex-start; }
    .hx-era { padding: 6px 12px; min-height: 48px; }
    .hx-match { grid-template-columns: minmax(0, 1fr); }
    .hx-slots--timeline { grid-template-columns: minmax(0, 1fr); }
    .hx-x-nav { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .hx-x-nav-map { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
    .hx-x-nav-link--prev { grid-column: 1; }
    .hx-x-nav-link--next { grid-column: 2; }
    .hx-pin { --pd: 36px; }
    .hx-pin-name { font-size: .76rem; padding: 2px 7px; }
    .hx-stone { width: 30px; height: 40px; margin-inline-start: -15px; margin-top: -20px; }
}

@media (prefers-reduced-motion: reduce) {
    .hx-route, .hx-pin-dot::after, .hx-stone.is-empty, .hx-fact-card.is-collected { animation: none; }
    .hx-polaroid, .hx-pin-dot, .hx-tl-card, .hx-xcard a, .hx-fact-card, .hx-card, .hx-opt, .hx-mitem, .hx-era, .hx-x-nav-link { transition: none; }
}
