/* ==========================================================================
   registry.css — the registry shell, shared by the four registry pages (Materials, Items, Jobs,
   Economy). Load AFTER /css/site.css. The old look (hard top bar, one framed scrolling box) was
   retired in registry-look step R.3 (2026-10-13); what is inside the panels of Materials / Items /
   Jobs is in registry-list.css, what is inside Economy's panels in economy.css.
   ========================================================================== */

.registry-message {
    text-align: center;
    padding: 20px;
}

.registry-message.error { color: red; }


/* ==========================================================================
   The registry shell (registry look, side-quest step R.1, 2026-10-13).
   Opt-in: only pages whose <body> has class "reg-page" get it (all four registry pages).
   - <body class="reg-page" data-theme="economy|materials|items|jobs"> picks the colours.
   - .reg-backdrop: the CSS backdrop behind everything (the permanent fallback for the light
     Pixi drift, registry-fx.js, whose canvas .reg-fx sits on top of it, still behind the content).
   - .page-links.reg-nav: the floating bar: Gateway pill (left), .reg-tabs (centre on wide
     screens, a pill at the bottom on phones), the quality glyph (right, fx-quality.js).
   - .reg-main: the page scrolls as a whole; .reg-hero, .reg-title, .reg-panel inside it.
   - Hover pop: transform/opacity/shadow only (cheap on Light), on press for touch screens.
   Tiers: backdrop blur on Full and Balanced only; html.calm (Still or reduced motion):
   no animation, no pop movement.
   ========================================================================== */

/* --- tuning knobs --- */
.reg-page {
    --reg-bar-h: 70px;              /* room the fixed bar takes at the top */
    --reg-pop-ms: 180ms;            /* hover pop duration */
    --reg-pop-ease: cubic-bezier(0.34, 1.56, 0.64, 1);   /* the soft overshoot */
    --reg-pop-y: -3px;              /* lift */
    --reg-pop-s: 1.03;              /* growth for cards and tabs */
    --reg-pop-row: 1.01;            /* growth for wide table rows (3% of a full-width row would be ~35 px) */
    --reg-shine-s: 7s;              /* one sweep of light over the title, with a pause */
    --reg-width: 80vw;              /* how much of the screen the content takes on wide screens */
    --reg-width-max: 1800px;        /* ... but never wider than this on huge monitors */
    --reg-width-min: 860px;         /* ... and never narrower than this (while the screen allows) */
}

/* --- themes: one accent pair per page --- */
.reg-page {
    --deep: #07060f;
    --deep2: #120f22;
    --ink: #e8e3f2;
    --ink-soft: #a9a2bf;
    --accent: #ffd24a;
    --accent2: #ffaf3a;
    --glint: #fff6d8;
    --title-fill: linear-gradient(180deg, var(--glint) 0%, var(--accent) 48%, var(--accent2) 100%);
}
.reg-page[data-theme="economy"]   { --accent: #ffd24a; --accent2: #e8952a; --glint: #fff6d8; }   /* minted gold */
.reg-page[data-theme="materials"] { --accent: #5ee6d0; --accent2: #a98bff; --glint: #e6fffb; }   /* ore and crystal */
.reg-page[data-theme="items"]     { --accent: #ffd76a; --accent2: #ff9e5e; --glint: #fffbe8; }   /* treasure */
.reg-page[data-theme="jobs"]      { --accent: #ff9a4a; --accent2: #ff5d2e; --glint: #ffe6c8; }   /* forge */
.reg-page { --travel-accent: var(--accent); --travel-ink: var(--ink); --travel-bg: var(--deep); --travel-bg2: var(--deep2); }

/* --- page base: site.css locks every page to one screen; these scroll as a whole --- */
html:has(.reg-page) { height: auto; overflow-y: auto; }
body.reg-page {
    width: auto;
    height: auto;
    min-height: 100vh;
    overflow-x: clip;
    overflow-y: visible;
    color: var(--ink);
    background: var(--deep);
    -webkit-tap-highlight-color: transparent;
}
.reg-page a:focus-visible,
.reg-page button:focus-visible,
.reg-page [tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* --- the backdrop (CSS only) --- */
.reg-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(1.5px 1.5px at 12% 22%, rgba(255, 255, 255, 0.55), transparent 60%),
        radial-gradient(1px 1px at 78% 14%, rgba(255, 255, 255, 0.45), transparent 60%),
        radial-gradient(1px 1px at 64% 68%, rgba(255, 255, 255, 0.35), transparent 60%),
        radial-gradient(1.5px 1.5px at 30% 82%, color-mix(in srgb, var(--glint) 60%, transparent), transparent 60%),
        radial-gradient(1px 1px at 90% 52%, color-mix(in srgb, var(--glint) 50%, transparent), transparent 60%),
        radial-gradient(1px 1px at 46% 40%, rgba(255, 255, 255, 0.3), transparent 60%),
        radial-gradient(ellipse 70% 45% at 50% -5%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
        radial-gradient(ellipse 55% 50% at 105% 70%, color-mix(in srgb, var(--accent2) 12%, transparent), transparent 70%),
        radial-gradient(ellipse 50% 45% at -5% 85%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
        radial-gradient(ellipse at 50% 40%, var(--deep2) 0%, var(--deep) 75%);
}
/* a soft dark edge so the panels read well over whatever moves behind them later */
.reg-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* the light drifting layer (registry-fx.js, step R.2): a canvas right after the backdrop, behind the
   content, never taking the pointer; it fades in once its first frame is drawn. Not there at all under
   html.calm, without WebGL or if anything fails: then the CSS backdrop above is the whole look. */
.reg-fx {
    position: fixed;
    top: 0; left: 0;
    width: 100% !important;         /* Pixi sets pixel sizes inline; the page decides */
    height: 100% !important;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.8s ease;
}
html.reg-fx-on .reg-fx { opacity: 1; }

/* --- the bar: Gateway, tabs, quality glyph --- */
.reg-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px 24px;
    pointer-events: none;           /* the fade lets clicks through; its controls take them */
    background: linear-gradient(color-mix(in srgb, var(--deep) 94%, transparent), transparent);
}
.reg-nav > * { pointer-events: auto; }
.reg-page .reg-nav .travel-link {
    min-height: 44px;
    box-sizing: border-box;
    padding: 0 16px 0 12px;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
}
.reg-page .fx-toggle.fx-toggle-bar {
    width: 44px; height: 44px;
    background: color-mix(in srgb, var(--deep) 70%, transparent);
    border-color: color-mix(in srgb, var(--accent) 40%, transparent);
    color: var(--accent);
}
.reg-page .fx-toggle.fx-toggle-bar svg { width: 20px; height: 20px; }
.reg-page .fx-panel.fx-panel-drop { top: 66px; }

/* the economy tabs: one segmented pill, the current page filled */
.reg-tabs {
    position: absolute;
    left: 50%; top: 9px;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--deep2) 88%, transparent);
    box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 12%, transparent), 0 6px 22px rgba(0, 0, 0, 0.45);
}
.reg-tabs a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    box-sizing: border-box;
    border-radius: 999px;
    font-family: var(--font-fantasy);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    color: var(--ink-soft);
    transition: color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease,
                transform var(--reg-pop-ms) var(--reg-pop-ease);
}
.reg-tabs a[aria-current="page"] {
    color: var(--deep);
    background: var(--accent);
    box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 55%, transparent);
}

/* --- the page --- */
.reg-main {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: min(100%, max(var(--reg-width), var(--reg-width-min)), var(--reg-width-max));
    margin: 0 auto;
    padding: calc(var(--reg-bar-h) + 18px) 28px 72px;
}
.reg-hero {
    text-align: center;
    padding: 4vh 0 10px;
}
.reg-kicker {
    margin: 0;
    font-family: var(--font-fantasy);
    font-size: 0.95rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--accent) 80%, var(--ink));
    opacity: 0.85;
}

/* the title: a metal fill with a sweep of light passing over it now and then */
.reg-title {
    margin: 0.02em 0 0;
    font-family: var(--font-fantasy);
    font-weight: 700;
    font-size: clamp(2.8rem, 8vw, 5.6rem);
    line-height: 1.22;               /* room for descenders: the gradient is clipped to the box, a tighter line cut the tail of a "y" */
    letter-spacing: 0.04em;
    color: transparent;
    background:
        linear-gradient(105deg, transparent 42%, color-mix(in srgb, var(--glint) 90%, transparent) 50%, transparent 58%) -160% 0 / 60% 100% no-repeat,
        var(--title-fill);
    -webkit-background-clip: text;
    background-clip: text;
    filter: drop-shadow(0 0 18px color-mix(in srgb, var(--accent) 35%, transparent))
            drop-shadow(0 2px 0 rgba(0, 0, 0, 0.5));
    animation: reg-shine var(--reg-shine-s) ease-in-out 1.2s infinite;
}
@keyframes reg-shine {
    0%   { background-position: -160% 0, 0 0; }
    45%  { background-position: 260% 0, 0 0; }
    100% { background-position: 260% 0, 0 0; }
}

/* the ornament under the title: two fine rules and a centre mark (a diamond; each theme may swap it) */
.reg-ornament {
    position: relative;
    display: block;
    width: min(320px, 70%);
    height: 16px;
    margin: 6px auto 18px;
}
.reg-ornament::before {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent) 30%, transparent 44%, transparent 56%, var(--accent) 70%, transparent);
    opacity: 0.7;
}
.reg-ornament::after {
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    width: 9px; height: 9px;
    transform: translate(-50%, -50%) rotate(45deg);
    border: 1px solid var(--accent);
    box-shadow: 0 0 8px var(--accent);
}
/* Economy: the centre mark is a coin, its rim catching the light */
.reg-page[data-theme="economy"] .reg-ornament::after {
    width: 14px; height: 14px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1.5px solid var(--glint);
    background: radial-gradient(circle at 35% 30%, var(--glint) 0 18%, var(--accent) 40%, var(--accent2) 100%);
    box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 80%, transparent), inset 0 0 0 2px color-mix(in srgb, var(--accent2) 60%, transparent);
}

.reg-lead {
    max-width: 980px;
    margin: 0 auto 30px;
    color: var(--ink-soft);
    font-size: 1.3rem;
    line-height: 1.55;
}

/* glass panels, one per section */
.reg-panel {
    position: relative;
    margin-bottom: 28px;
    padding: 32px 36px;
    box-sizing: border-box;
    border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(22, 18, 38, 0.86), rgba(10, 8, 20, 0.9));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 40px rgba(0, 0, 0, 0.35);
}
html[data-quality="full"] .reg-panel,
html[data-quality="balanced"] .reg-panel {
    background: linear-gradient(180deg, rgba(22, 18, 38, 0.6), rgba(10, 8, 20, 0.72));
    -webkit-backdrop-filter: blur(12px) saturate(1.15);
    backdrop-filter: blur(12px) saturate(1.15);
}
/* a thin light along the panel's top edge */
.reg-panel::before {
    content: '';
    position: absolute;
    left: 24px; right: 24px; top: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 70%, transparent), transparent);
    pointer-events: none;
}

/* --- hover pop for the shared parts (each page adds its own cards and rows the same way) --- */
@media (hover: hover) {
    .reg-tabs a:not([aria-current="page"]):hover {
        color: var(--ink);
        background: color-mix(in srgb, var(--accent) 14%, transparent);
        transform: translateY(var(--reg-pop-y)) scale(var(--reg-pop-s));
    }
}
@media (hover: none) {
    .reg-tabs a:active { transform: translateY(var(--reg-pop-y)) scale(var(--reg-pop-s)); }
}

/* --- phones and narrow windows: the tabs become a pill at the bottom, within thumb's reach --- */
@media (max-width: 760px) {
    .reg-page { --reg-bar-h: 62px; }
    .reg-nav { padding: 9px 12px 20px; }
    .reg-page .reg-nav .travel-link { font-size: 0.7rem; padding: 0 14px 0 11px; }
    .reg-page .fx-toggle.fx-toggle-bar { width: 44px; height: 44px; }
    .reg-page .fx-panel.fx-panel-drop { top: 60px; }
    .reg-tabs {
        position: fixed;
        top: auto; bottom: 12px;
        left: 50%;
        max-width: calc(100vw - 20px);
        box-sizing: border-box;
        overflow-x: auto;           /* if the tabs ever outgrow the screen they scroll inside the pill */
        scrollbar-width: none;
        box-shadow: 0 8px 26px rgba(0, 0, 0, 0.75), 0 0 14px color-mix(in srgb, var(--accent) 16%, transparent);
    }
    .reg-tabs::-webkit-scrollbar { display: none; }
    .reg-tabs a { padding: 0 11px; font-size: 0.7rem; letter-spacing: 0.05em; }   /* 0.7rem = 11.2 px, the smallest text probe.py accepts */
    .reg-main { padding: calc(var(--reg-bar-h) + 8px) 14px 104px; }
    .reg-hero { padding-top: 2vh; }
    .reg-lead { font-size: 1.05rem; }
    .reg-panel { padding: 20px 16px; border-radius: 16px; margin-bottom: 20px; }
}
/* landscape phones: the bar scrolls away with the page instead of covering a fifth of the screen */
@media (max-height: 500px) and (min-width: 761px) {
    .reg-nav { position: absolute; }
}

/* --- calm (Still tier or reduced motion): nothing moves, hovers only change colour --- */
html.calm .reg-page { --reg-pop-y: 0px; --reg-pop-s: 1; --reg-pop-row: 1; }
html.calm .reg-title { animation: none; background-position: -160% 0, 0 0; }
