/* ===========================================================================
   Superhero Fight — base layer
   Theme: "The Arena Dossier" — graphic-novel ink arena, aged-paper sheets.
   Display: Anton · UI: Archivo · Narrative: Fraunces
   =========================================================================== */

:root {
    /* Ink / arena */
    --ink:        #14100c;   /* warm near-black backdrop          */
    --ink-2:      #1d1711;   /* raised ink panels                 */
    --ink-line:   #322a20;   /* hairlines on dark                 */

    /* Paper / dossier */
    --paper:      #f1e7d3;   /* aged paper sheet                  */
    --paper-2:    #e7dabf;   /* paper edge / fill                 */
    --paper-ink:  #221a10;   /* text on paper                     */
    --paper-mute: #6f6044;   /* secondary text on paper           */

    /* Action palette */
    --red:        #ff3b2f;   /* action / RED corner               */
    --red-deep:   #cf241a;
    --blue:       #2f7bff;   /* BLUE corner                       */
    --blue-deep:  #1857d6;
    --gold:       #ffc23d;   /* winner                            */

    /* Type on dark */
    --cream:      #f4ecdc;
    --muted:      #ad9f88;   /* secondary text on dark            */

    --font-display: 'Anton', Impact, sans-serif;
    --font-ui:      'Archivo', system-ui, sans-serif;
    --font-read:    'Fraunces', Georgia, 'Times New Roman', serif;

    --shadow-hard:  6px 6px 0 rgba(0, 0, 0, 0.55);
    --radius:       4px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: var(--font-ui);
    color: var(--cream);
    background-color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    min-height: 100vh;
    /* Atmosphere: corner spotlights + halftone dot field + grain */
    background-image:
        radial-gradient(120% 80% at 12% -10%, rgba(47, 123, 255, 0.16), transparent 55%),
        radial-gradient(120% 80% at 92% 0%, rgba(255, 59, 47, 0.16), transparent 55%),
        radial-gradient(80% 60% at 50% 120%, rgba(255, 194, 61, 0.08), transparent 60%),
        radial-gradient(rgba(255, 255, 255, 0.045) 1.1px, transparent 1.2px);
    background-size: auto, auto, auto, 22px 22px;
    background-attachment: fixed;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 0.98;
    text-transform: uppercase;
}

h1:focus { outline: none; }

a {
    color: var(--gold);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 194, 61, 0.35);
    transition: color 0.15s ease, border-color 0.15s ease;
}

a:hover {
    color: #ffd97a;
    border-color: currentColor;
}

code {
    color: var(--gold);
    font-family: 'Archivo', monospace;
}

/* --- Validation (Blazor) --------------------------------------------------- */

.valid.modified:not([type=checkbox]) { outline: none; }

.invalid {
    outline: 2px solid var(--red);
    outline-offset: 1px;
}

.validation-message {
    color: var(--red-deep);
    font-size: 0.85rem;
    font-weight: 600;
}

/* --- Blazor error UI ------------------------------------------------------- */

#blazor-error-ui {
    color-scheme: dark only;
    background: var(--gold);
    color: var(--ink);
    bottom: 0;
    box-shadow: 0 -2px 0 rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-weight: 700;
}

    #blazor-error-ui .reload { color: var(--ink); }

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: var(--red-deep);
    padding: 1rem 1rem 1rem 1rem;
    color: white;
    font-weight: 600;
}

    .blazor-error-boundary::after { content: "Something broke in the arena."; }

/* --- Loading splash -------------------------------------------------------- */

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 30vh 0 auto 0;
    margin: 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: rgba(255, 255, 255, 0.12);
        stroke-width: 0.5rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--red);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cream);
    inset: calc(30vh + 3.25rem) 0 auto 0;
}

    .loading-progress-text:after { content: var(--blazor-load-percentage-text, "Entering the arena"); }
