/* ==========================================================================
   HALLOWHOST — global theme
   Gothic Total War-style chrome: blackened iron, aged gold, pumpkin fire,
   ghost-light green and blood-moon red.
   ========================================================================== */

@font-face { font-family: 'Cinzel'; font-weight: 400; font-display: swap; src: url('fonts/cinzel-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cinzel'; font-weight: 600; font-display: swap; src: url('fonts/cinzel-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cinzel'; font-weight: 700; font-display: swap; src: url('fonts/cinzel-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cinzel'; font-weight: 900; font-display: swap; src: url('fonts/cinzel-latin-900-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cinzel Decorative'; font-weight: 400; font-display: swap; src: url('fonts/cinzel-decorative-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cinzel Decorative'; font-weight: 700; font-display: swap; src: url('fonts/cinzel-decorative-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cinzel Decorative'; font-weight: 900; font-display: swap; src: url('fonts/cinzel-decorative-latin-900-normal.woff2') format('woff2'); }
@font-face { font-family: 'IM Fell English'; font-weight: 400; font-display: swap; src: url('fonts/im-fell-english-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IM Fell English'; font-style: italic; font-weight: 400; font-display: swap; src: url('fonts/im-fell-english-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Alegreya'; font-weight: 400; font-display: swap; src: url('fonts/alegreya-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Alegreya'; font-style: italic; font-weight: 400; font-display: swap; src: url('fonts/alegreya-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Alegreya'; font-weight: 600; font-display: swap; src: url('fonts/alegreya-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Alegreya'; font-weight: 700; font-display: swap; src: url('fonts/alegreya-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Creepster'; font-weight: 400; font-display: swap; src: url('fonts/creepster-latin-400-normal.woff2') format('woff2'); }

:root {
    --hh-bg: #07060b;
    --hh-bg-2: #0e0b16;
    --hh-panel: rgba(14, 11, 20, 0.86);
    --hh-panel-solid: #120e1a;
    --hh-panel-hi: rgba(32, 24, 44, 0.92);
    --hh-iron: #2a2433;
    --hh-iron-hi: #3d3449;
    --hh-gold: #d9a441;
    --hh-gold-hi: #f6d27a;
    --hh-gold-dim: #8a6a2c;
    --hh-parchment: #e8dcc0;
    --hh-text: #e6dfd2;
    --hh-text-dim: #a59c8f;
    --hh-text-faint: #6f6779;
    --hh-pumpkin: #ff7a18;
    --hh-pumpkin-hi: #ffb347;
    --hh-ghost: #7dffb0;
    --hh-ghost-dim: #3f8f68;
    --hh-blood: #b3202a;
    --hh-blood-hi: #ff4a4a;
    --hh-violet: #8a5cd6;
    --hh-moon: #cfd8ff;
    --hh-ok: #69d17a;
    --hh-warn: #ffbf47;

    --hh-font-display: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
    --hh-font-head: 'Cinzel', Georgia, serif;
    /* Body text and numbers: a book face that stays legible small. IM Fell is kept for italic flavour lines. */
    --hh-font-body: 'Alegreya', Georgia, 'Times New Roman', serif;
    --hh-font-flavor: 'IM Fell English', Georgia, 'Times New Roman', serif;
    --hh-font-spooky: 'Creepster', 'Cinzel Decorative', fantasy;

    --hh-radius: 3px;
    --hh-shadow: 0 10px 40px rgba(0, 0, 0, 0.65);
    --hh-glow-gold: 0 0 18px rgba(217, 164, 65, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--hh-bg);
    color: var(--hh-text);
    font-family: var(--hh-font-body);
    font-size: 17px;
    font-variant-numeric: lining-nums;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--hh-gold); }
a:hover { color: var(--hh-gold-hi); }

h1, h2, h3, h4 { font-family: var(--hh-font-head); letter-spacing: 0.04em; margin: 0 0 0.5em; }
h1:focus { outline: none; }

::selection { background: rgba(255, 122, 24, 0.45); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.3); }
::-webkit-scrollbar-thumb { background: var(--hh-iron-hi); border: 2px solid rgba(0, 0, 0, 0.3); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--hh-gold-dim); }

/* ---------- Boot splash (visible until the WebAssembly app covers it) ---------- */

#hh-boot {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(80, 60, 140, 0.35), transparent 60%),
        radial-gradient(ellipse at 50% 110%, rgba(255, 110, 20, 0.18), transparent 55%),
        var(--hh-bg);
}

.hh-boot-moon {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 36%, #fffbe8, #e9dcb4 45%, #b9a77a 75%);
    box-shadow: 0 0 60px rgba(255, 240, 200, 0.45), 0 0 140px rgba(160, 140, 255, 0.25);
    animation: hh-moon-pulse 3.5s ease-in-out infinite;
}

.hh-boot-title {
    font-family: var(--hh-font-display);
    font-weight: 900;
    font-size: clamp(2.2rem, 6vw, 4.2rem);
    letter-spacing: 0.12em;
    text-align: center;
    text-transform: uppercase;
    line-height: 1;
    color: var(--hh-gold);
    text-shadow: 0 0 24px rgba(255, 122, 24, 0.45), 0 3px 0 #000;
}

.hh-boot-title-pre {
    display: block;
    font-size: 0.45em;
    letter-spacing: 0.3em;
    margin-bottom: 0.15em;
}

.hh-boot-tag {
    font-family: var(--hh-font-flavor);
    font-style: italic;
    color: var(--hh-text-dim);
}

.hh-boot-bar {
    width: min(360px, 70vw);
    height: 6px;
    border: 1px solid var(--hh-gold-dim);
    background: rgba(0, 0, 0, 0.5);
}

.hh-boot-fill {
    height: 100%;
    width: var(--blazor-load-percentage, 8%);
    background: linear-gradient(90deg, var(--hh-blood), var(--hh-pumpkin));
    box-shadow: 0 0 12px var(--hh-pumpkin);
    transition: width 0.2s;
}

@keyframes hh-moon-pulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.03); filter: brightness(1.12); }
}

/* ---------- Generic page scaffolding ---------- */

.hh-page {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    padding: 28px clamp(16px, 4vw, 48px) 48px;
}

.hh-center { display: flex; align-items: center; justify-content: center; }

.hh-static-page { max-width: 760px; margin: 60px auto; padding: 0 16px; }

.hh-panel {
    background: var(--hh-panel);
    border: 1px solid var(--hh-iron-hi);
    outline: 1px solid rgba(0, 0, 0, 0.8);
    box-shadow: var(--hh-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    padding: 20px 24px;
    position: relative;
}

.hh-panel::before {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px solid rgba(217, 164, 65, 0.16);
    pointer-events: none;
}

.hh-title-sm {
    font-family: var(--hh-font-display);
    color: var(--hh-gold);
    font-size: 1.8rem;
    text-shadow: 0 2px 0 #000;
}

.hh-flavor { font-family: var(--hh-font-flavor); font-style: italic; color: var(--hh-text-dim); line-height: 1.5; }

/* ---------- Buttons ---------- */

.hh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    font-family: var(--hh-font-head);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--hh-parchment);
    background: linear-gradient(180deg, #3a2f45, #1d1724);
    border: 1px solid var(--hh-gold-dim);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 8px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    user-select: none;
    transition: transform 0.08s, box-shadow 0.15s, border-color 0.15s, color 0.15s;
}

.hh-btn:hover {
    color: #fff;
    border-color: var(--hh-gold);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 16px rgba(217, 164, 65, 0.35);
}

.hh-btn:active { transform: translateY(1px); }
.hh-btn:disabled, .hh-btn.disabled { opacity: 0.45; pointer-events: none; }

.hh-btn-primary {
    background: linear-gradient(180deg, #a2410d, #5c1f07);
    border-color: var(--hh-pumpkin-hi);
    color: #fff3e2;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

.hh-btn-primary:hover { box-shadow: 0 0 24px rgba(255, 122, 24, 0.55); border-color: #ffd29a; }

.hh-btn-ghost {
    background: linear-gradient(180deg, #1f4a37, #0d2219);
    border-color: var(--hh-ghost-dim);
    color: #dfffee;
}

.hh-btn-ghost:hover { box-shadow: 0 0 24px rgba(125, 255, 176, 0.4); border-color: var(--hh-ghost); }

.hh-btn-sm { padding: 6px 12px; font-size: 0.84rem; }

/* ---------- Form controls ---------- */

.hh-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.hh-field > label, .hh-label {
    font-family: var(--hh-font-head);
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--hh-gold);
}

.hh-input, .hh-select {
    font-family: var(--hh-font-body);
    font-size: 1rem;
    color: var(--hh-text);
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--hh-iron-hi);
    padding: 8px 10px;
    border-radius: var(--hh-radius);
}

.hh-input:focus, .hh-select:focus { outline: none; border-color: var(--hh-gold); box-shadow: var(--hh-glow-gold); }
.hh-select option { background: var(--hh-panel-solid); }

input[type=range].hh-range { accent-color: var(--hh-pumpkin); width: 100%; }
input[type=checkbox].hh-check { accent-color: var(--hh-pumpkin); width: 18px; height: 18px; }

/* ---------- Error UI ---------- */

#blazor-error-ui {
    color-scheme: dark only;
    background: #2a0b0e;
    color: var(--hh-text);
    border-top: 1px solid var(--hh-blood);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.6);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

.blazor-error-boundary {
    background: #2a0b0e;
    border: 1px solid var(--hh-blood);
    padding: 1rem 1.25rem;
    color: var(--hh-text);
}

.blazor-error-boundary::after { content: "An error has occurred."; }
