/*
 * The Sports IQ palette - the one file the site and the admin panel share.
 *
 * WHY THIS EXISTS. Both apps load the same vendor theme (style.css) and then
 * their own layer on top: site.css for the site, admin.css for the panel. The
 * palette was defined in BOTH of those, and the copies drifted. The panel's
 * header said "Same palette as the site" while holding the values the site's
 * accessibility work had replaced months earlier:
 *
 *     panel        site now      why the site changed it
 *     #4EA8FF  ->  #0075E5       2.51:1 under white text
 *     #9B6BFF  ->  #8950FF       3.53:1 on white
 *     #2FA36B  ->  #278758       3.20:1 either way
 *     #E5484D  ->  #E12F34       3.91:1 on white
 *     #D1852B  ->  #A56922       2.96:1 on white
 *
 * So the admin side was not just a different shade from the site - it was
 * running five colours that fail WCAG AA in light mode, on the screens staff
 * look at all day.
 *
 * Both apps now load this file, and neither declares these tokens itself.
 * The two copies must stay identical; the check is in
 * panel/docs/DEPLOYMENT.md.
 *
 * THE RULE: light mode first, dark mode after. :root and .dark-theme carry
 * the same specificity, so anything the dark block does not restate keeps the
 * light value - which is why several colours are repeated below at what looks
 * like no change. They are not redundant; removing them breaks dark mode.
 */

:root {
    /* Text */
    /*
     * Light-mode ink. #73777D sat at 4.50 on white and below it on any tinted
     * card, so explanatory text across both apps was failing AA by a hair.
     * One step darker clears it everywhere at once; dark mode is unchanged and
     * still lifts this to #ADB0B4 below.
     */
    --Note: #6B6F75;

    /* Roles, not shades: accent is "ours", good/bad/warn are outcomes. */
    /*
     * #0075E5 measured 4.49 as ink on white - under AA by a rounding error,
     * in card titles, links, tabs and value text throughout. Darkened to match
     * --siq-accent-solid, which is what pages had been reaching for one at a
     * time. Dark mode still lifts this to #5CB0FF below.
     */
    --siq-accent: #006BCF;
    --siq-accent-alt: #8950FF;
    --siq-good: #278758;
    --siq-warn: #A56922;
    --siq-bad: #E12F34;

    /* The tours. Same in both themes - they are brand colours, not ink. */
    --tour-atp: #0057FF;
    --tour-wta: #9333EA;

    /* ── Court surfaces, defined once ──────────────────────────────────
       These were written out in four different places - the fixture bars,
       the Elo panel, the little dots and the tournaments page - in three
       different palettes, and the tournaments page built its own class name
       so Indoor and Acrylic matched no rule at all and fell back to the same
       colour as Hard. Hence two surfaces looking blue.

       One set, one definition, and six colours nobody can confuse for each
       other. Every one carries white text at these values. */
    --surface-hard: #2C7DB0;    /* blue   */
    --surface-ihard: #8046C8;   /* purple */
    --surface-clay: #C1622F;    /* orange */
    --surface-grass: #2C8659;   /* green  */
    --surface-carpet: #8D6E63;  /* brown  */
    --surface-unknown: #6B7280; /* grey   */
}

.dark-theme {
    /* Lifted for the dark card surface, where the light-mode inks go muddy. */
    /*
     * Dark-mode secondary ink. #ADB0B4 read as a flat grey against white body
     * text; lifted much closer to it so the two look like one family with a
     * step between them, rather than white text and grey text.
     */
    --Note: #C8CDD4;
    --surface-hard: #4FA3DC;
    --surface-ihard: #A579E8;
    --surface-clay: #E08A4B;
    --surface-grass: #45B07C;
    --surface-carpet: #B08C7D;
    --surface-unknown: #94A3B8;

    --siq-accent: #5CB0FF;
    --siq-accent-alt: #BE9FFF;
    --siq-good: #38BC7C;
    --siq-warn: #F0AE2F;
    --siq-bad: #EE8286;
}

/*
 * Solid fills keep ONE value in both themes, because white text sits on them
 * and has to pass in both: the pale blue that reads well AS text on a dark
 * card is far too light UNDER white text.
 */
:root,
.dark-theme {
    --siq-accent-solid: #006BCF;
    --siq-good-solid: #23794E;
    --siq-bad-solid: #C4282C;
}
