/* ---------- Design tokens ---------- */

:root {
    color-scheme: light;

    --bg: #EEF1EC;          /* chalk */
    --panel: #F9FBF8;       /* paper for inputs */
    --ink: #18201D;
    --muted: #56625C;
    --line: #CBD3CC;
    --focus: #2F6FAE;

    --felt: #0E5A47;        /* betting-table green for the result */
    --felt-ink: #FFFFFF;
    --felt-muted: #BFD8CF;
    --felt-line: rgb(255 255 255 / 0.16);
    --felt-down: #FF9AA8;

    /* One color per outcome: used in the swatches and the balance bar */
    --seg-0: #E9B949;       /* gold */
    --seg-1: #7FB8E6;       /* sky */
    --seg-2: #B9A3E3;       /* lilac */
    --seg-3: #E6D3A8;       /* sand */

    --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;

        --bg: #0F1513;
        --panel: #172019;
        --ink: #E4EAE6;
        --muted: #98A59F;
        --line: #2C3833;
        --focus: #7FB8E6;

        --felt: #12392F;
        --felt-muted: #A7C4BA;
    }
}

/* ---------- Base ---------- */

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.5;
}

a {
    color: inherit;
    text-underline-offset: 0.2em;
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* ---------- Not found page ---------- */

.not-found h1 {
    margin: 0 0 0.75rem;
    font-size: 2rem;
    font-weight: 800;
    font-stretch: 112%;
}

.not-found h1:focus {
    outline: none;
}

/* ---------- Blazor loading and error UI ---------- */

#blazor-error-ui {
    background: #FFF4D6;
    color: #18201D;
    bottom: 0;
    box-shadow: 0 -1px 2px rgb(0 0 0 / 0.2);
    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 {
    padding: 1rem;
    background: #B4233B;
    color: white;
}

    .blazor-error-boundary::after {
        content: "Something went wrong. Reload the page to try again.";
    }

/* ---------- Guide (How it works + Questions) ----------
   Global, not component-scoped: the same markup is also in index.html. */

.guide {
    max-width: 44rem;
    margin-top: 4.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--line);
}

.guide h2 {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    font-weight: 800;
    font-stretch: 112%;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.guide h2:not(:first-child) {
    margin-top: 3rem;
}

.guide h3 {
    margin: 2rem 0 0.5rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.guide p {
    margin: 0 0 1rem;
}

.guide dl {
    margin: 0;
}

.guide dt {
    margin-top: 1.5rem;
    font-weight: 700;
}

.guide dd {
    margin: 0.375rem 0 0;
    color: var(--muted);
}

/* "What else it can do" */
.guide .features {
    display: grid;
    gap: 0.625rem;
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    color: var(--muted);
}

.guide .features strong {
    color: var(--ink);
}

/* Answers with a list ("What can go wrong?") */
.guide dd p {
    margin: 0 0 0.5rem;
}

.guide dd ul {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding-left: 1.25rem;
}

.guide dd strong {
    color: var(--ink);
}

/* ---------- Static page shown while Blazor loads (index.html) ----------
   Mirrors MainLayout and the calculator intro, so the switch is calm. */

.static-page {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 16px 4rem;
    box-sizing: border-box;
}

.static-masthead {
    padding: 1.5rem 0 2rem;
}

.static-wordmark {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.25rem;
    font-weight: 800;
    font-stretch: 125%;
    letter-spacing: -0.01em;
}

.static-page h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    font-stretch: 112%;
    letter-spacing: -0.02em;
    line-height: 1.05;
}

/* Same title size as the calculator on wide screens, so nothing jumps when the app loads. */
@media (min-width: 860px) {
    .static-page h1 {
        font-size: 2.5rem;
    }
}

.static-wordmark .logo-icon {
    width: 2rem;
    height: 2rem;
    flex: none;
}

.static-intro {
    margin: 0.75rem 0 0;
    max-width: 34rem;
    color: var(--muted);
    font-size: 1.0625rem;
}

/* Same look as .intro .perks in Calculator.razor.css */
.static-perks {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Same look as .footnote in MainLayout.razor.css */
.static-footnote {
    margin-top: 4rem;
    padding: 1.5rem 0 2rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.875rem;
}

.static-footnote p {
    margin: 0;
    max-width: 40rem;
}

.static-footnote p + p {
    margin-top: 0.75rem;
}

.static-footnote a {
    color: inherit;
}

.loading-progress-text {
    margin: 2rem 0 0;
    padding: 1.25rem 1.5rem;
    border-radius: 10px;
    background: var(--felt);
    color: var(--felt-muted);
    font-weight: 600;
    max-width: 30rem;
}

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