@import 'tailwindcss';
@import 'tw-animate-css';
@import 'shadcn/tailwind.css';

@custom-variant dark (&:is(.dark *));

@theme inline {
  --font-sans: var(--font-nunito), ui-sans-serif, system-ui, sans-serif;
  --color-sidebar-ring: var(--sidebar-ring);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar: var(--sidebar);
  --color-chart-6: var(--chart-6);
  --color-chart-5: var(--chart-5);
  --color-chart-4: var(--chart-4);
  --color-chart-3: var(--chart-3);
  --color-chart-2: var(--chart-2);
  --color-chart-1: var(--chart-1);
  --color-ring: var(--ring);
  --color-input: var(--input);
  --color-border: var(--border);
  --color-destructive: var(--destructive);
  --color-accent-foreground: var(--accent-foreground);
  --color-accent: var(--accent);
  --color-muted-foreground: var(--muted-foreground);
  --color-muted: var(--muted);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-secondary: var(--secondary);
  --color-primary-foreground: var(--primary-foreground);
  --color-primary: var(--primary);
  --color-popover-foreground: var(--popover-foreground);
  --color-popover: var(--popover);
  --color-card-foreground: var(--card-foreground);
  --color-card: var(--card);
  --color-foreground: var(--foreground);
  --color-background: var(--background);
  --color-brand-orange: var(--brand-orange);
  --color-brand-orange-foreground: var(--brand-orange-foreground);
  --color-info: var(--info);
  --color-info-foreground: var(--info-foreground);
  --color-gold: var(--gold);
  --color-gold-foreground: var(--gold-foreground);
  --radius-sm: calc(var(--radius) * 0.6);
  --radius-md: calc(var(--radius) * 0.8);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) * 1.4);
  --radius-2xl: calc(var(--radius) * 1.8);
  --radius-3xl: calc(var(--radius) * 2.2);
  --radius-4xl: calc(var(--radius) * 2.6);
}

:root {
  color-scheme: light;
  /* Full clubhouse-overtagelse (ADR-052, 2026-08-10) -- disse
     shadcn-tokenene pekte tidligere på "Forest Green" (nøytral grå +
     lys grønn primary). De peker nå på clubhouse-paletten (definert
     lenger ned i denne filen, --tee-strong/--clubhouse-*) -- samme
     verdier, kopiert inn her slik at bg-primary/bg-card/
     text-muted-foreground osv. arver clubhouse over HELE appen uten at
     noen av de ~90 filene som bruker disse klassenavnene trenger å
     endres. Se ARCHITECTURE_DECISIONS.md ADR-052 for full begrunnelse,
     inkludert hvorfor destructive/brand-orange/info/gold/chart-1..6
     bevisst IKKE er endret her. */
  --background: #f3f6ec;
  --foreground: #17200f;
  --card: #ffffff;
  --card-foreground: #17200f;
  --popover: #ffffff;
  --popover-foreground: #17200f;
  --primary: #2f6b1e;
  --primary-foreground: #ffffff;
  --secondary: #f7f9f3;
  --secondary-foreground: #17200f;
  --muted: #f7f9f3;
  --muted-foreground: #515b45;
  --accent: #f7f9f3;
  --accent-foreground: #17200f;
  --destructive: oklch(0.577 0.245 27.325);
  --border: #dbe1cd;
  --input: #dbe1cd;
  --ring: #2f6b1e;
  --brand-orange: oklch(0.6792 0.2128 36.53);
  --brand-orange-foreground: oklch(0.99 0 0);
  /* Løftet fra chart-3/chart-4 (2026-07-28, se DESIGN_SYSTEM.md) -- egne
     kjernetoken for nøytral informasjon (--info) og personlig-rekord/
     merkeverdig-prestasjon (--gold), samme validerte OKLCH-verdier som
     statistikk-skalaen bruker allerede. */
  --info: oklch(0.68 0.13 210);
  --info-foreground: oklch(0.99 0 0);
  --gold: oklch(0.79 0.15 85);
  --gold-foreground: oklch(0.22 0.04 85);
  /* Statistikk-fargeskala (rundestatistikk, ADR-033) -- brukt sammen med
     tekst-/tall-etiketter, aldri farge alene som eneste signal. */
  --chart-1: oklch(0.55 0.15 160);
  --chart-2: oklch(0.72 0.17 140);
  --chart-3: oklch(0.68 0.13 210);
  --chart-4: oklch(0.79 0.15 85);
  --chart-5: oklch(0.68 0.2 45);
  --chart-6: oklch(0.57 0.22 25);
  --radius: 0.625rem;
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-primary: oklch(0.205 0 0);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.97 0 0);
  --sidebar-accent-foreground: oklch(0.205 0 0);
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-ring: oklch(0.708 0 0);
}

.dark {
  color-scheme: dark;
  /* Mørk clubhouse-variant, ADR-052 -- fargeverdier designet av V0 på
     bestilling (samme oppgave-/rolledeling som resten av clubhouse),
     låst referanse: --tee/--tee-strong/--cup/--cup-strong/
     --clubhouse-* i den mørke blokken lenger ned i filen. AA-verifisert
     av Claude (egen kontrastberegning, ikke bare V0s egne påstander):
     ink/bg 15.7:1, muted/bg 8.2:1, muted/card 7.2:1, hvit/tee-strong
     4.76:1. */
  --background: #131a0f;
  --foreground: #eef3e6;
  --card: #1d2616;
  --card-foreground: #eef3e6;
  --popover: #1d2616;
  --popover-foreground: #eef3e6;
  --primary: #3c8226;
  --primary-foreground: #ffffff;
  --secondary: #26301d;
  --secondary-foreground: #eef3e6;
  --muted: #26301d;
  --muted-foreground: #a7b598;
  --accent: #26301d;
  --accent-foreground: #eef3e6;
  --destructive: oklch(0.704 0.191 22.216);
  --border: #34402a;
  --input: #34402a;
  --ring: #3c8226;
  --brand-orange: oklch(0.6792 0.2128 36.53);
  --brand-orange-foreground: oklch(0.16 0.02 40);
  --info: oklch(0.75 0.13 210);
  --info-foreground: oklch(0.16 0.02 210);
  --gold: oklch(0.83 0.14 85);
  --gold-foreground: oklch(0.18 0.03 85);
  /* Statistikk-fargeskala, løftet for kontrast på mørk bakgrunn. */
  --chart-1: oklch(0.7 0.16 160);
  --chart-2: oklch(0.79 0.17 140);
  --chart-3: oklch(0.75 0.13 210);
  --chart-4: oklch(0.83 0.14 85);
  --chart-5: oklch(0.73 0.19 45);
  --chart-6: oklch(0.66 0.21 25);
  --sidebar: oklch(0.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.556 0 0);
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    color-scheme: dark;
    /* Speiler .dark-blokken over -- se kommentar der (ADR-052). */
    --background: #131a0f;
    --foreground: #eef3e6;
    --card: #1d2616;
    --card-foreground: #eef3e6;
    --popover: #1d2616;
    --popover-foreground: #eef3e6;
    --primary: #3c8226;
    --primary-foreground: #ffffff;
    --secondary: #26301d;
    --secondary-foreground: #eef3e6;
    --muted: #26301d;
    --muted-foreground: #a7b598;
    --accent: #26301d;
    --accent-foreground: #eef3e6;
    --destructive: oklch(0.704 0.191 22.216);
    --border: #34402a;
    --input: #34402a;
    --ring: #3c8226;
    --brand-orange: oklch(0.6792 0.2128 36.53);
    --brand-orange-foreground: oklch(0.16 0.02 40);
    --info: oklch(0.75 0.13 210);
    --info-foreground: oklch(0.16 0.02 210);
    --gold: oklch(0.83 0.14 85);
    --gold-foreground: oklch(0.18 0.03 85);
    --chart-1: oklch(0.7 0.16 160);
    --chart-2: oklch(0.79 0.17 140);
    --chart-3: oklch(0.75 0.13 210);
    --chart-4: oklch(0.83 0.14 85);
    --chart-5: oklch(0.73 0.19 45);
    --chart-6: oklch(0.66 0.21 25);
    --sidebar: oklch(0.205 0 0);
    --sidebar-foreground: oklch(0.985 0 0);
    --sidebar-primary: oklch(0.488 0.243 264.376);
    --sidebar-primary-foreground: oklch(0.985 0 0);
    --sidebar-accent: oklch(0.269 0 0);
    --sidebar-accent-foreground: oklch(0.985 0 0);
    --sidebar-border: oklch(1 0 0 / 10%);
    --sidebar-ring: oklch(0.556 0 0);
  }
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
  }
}

/* ------------------------------------------------------------------ */
/* Clubhouse-paletten -- opprinnelig fra /logg-inn-utforskningen        */
/* (ADR-047-oppfølging, 2026-08-07), nå selve kildepaletten for HELE    */
/* appen (ADR-052, 2026-08-10). Tokens over (--background/--primary/    */
/* osv.) kopierer disse verdiene direkte. Mørk variant lagt til her     */
/* under, designet av V0 på bestilling -- se ADR-052.                   */
/* ------------------------------------------------------------------ */
:root {
  --tee: #8bbd51;
  --tee-strong: #2f6b1e;
  --cup: #ff5427;
  --cup-strong: #cf3c17;
  --clubhouse-bg: #f3f6ec;
  --clubhouse-card: #ffffff;
  --clubhouse-ink: #17200f;
  --clubhouse-muted: #515b45;
  --clubhouse-border: #dbe1cd;
  --clubhouse-field: #f7f9f3;
}

/* Mørk clubhouse-variant -- samme kilde/AA-verifisering som .dark-
   blokken over. */
.dark {
  --tee: #a3d165;
  --tee-strong: #3c8226;
  --cup: #ff6a3d;
  --cup-strong: #ff8355;
  --clubhouse-bg: #131a0f;
  --clubhouse-card: #1d2616;
  --clubhouse-ink: #eef3e6;
  --clubhouse-muted: #a7b598;
  --clubhouse-border: #34402a;
  --clubhouse-field: #26301d;
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    --tee: #a3d165;
    --tee-strong: #3c8226;
    --cup: #ff6a3d;
    --cup-strong: #ff8355;
    --clubhouse-bg: #131a0f;
    --clubhouse-card: #1d2616;
    --clubhouse-ink: #eef3e6;
    --clubhouse-muted: #a7b598;
    --clubhouse-border: #34402a;
    --clubhouse-field: #26301d;
  }
}

@theme inline {
  --color-tee: var(--tee);
  --color-tee-strong: var(--tee-strong);
  --color-cup: var(--cup);
  --color-cup-strong: var(--cup-strong);
  --color-clubhouse-bg: var(--clubhouse-bg);
  --color-clubhouse-card: var(--clubhouse-card);
  --color-clubhouse-ink: var(--clubhouse-ink);
  --color-clubhouse-muted: var(--clubhouse-muted);
  --color-clubhouse-border: var(--clubhouse-border);
  --color-clubhouse-field: var(--clubhouse-field);
}

/* ------------------------------------------------------------------ */
/* /my-rounds/new -- opprinnelig en egen V0-utforskning (2026-08-08,    */
/* kald blå/grå, uavhengig av "Forest Green"). Retemaet til clubhouse   */
/* 2026-08-10 (ADR-053, samme økt som ADR-052-hovedovertagelsen) --     */
/* bruker ba eksplisitt om at veiviseren også skulle få "det nye        */
/* designet". Samme remap-prinsipp som ADR-052: disse 16 --nr-*-        */
/* variablene er den ENESTE kilden komponentene i components/ny-runde/* */
/* leser (via `var(--nr-x)`, ikke `@theme inline`) -- kun VERDIENE      */
/* under er endret, ingen av de 11 filene er rørt. `--nr-danger(-soft)`/*/
/* `--nr-ok(-soft)` beholder sin opprinnelige, distinkte rød/grønn-hue  */
/* (samme prinsipp som `--destructive` i hovedpaletten, ADR-052) --     */
/* kun bakgrunn/kant/aksent er byttet til clubhouse. `--nr-faint`/      */
/* `--nr-border-strong`/`--nr-accent-soft`/`--nr-accent-ring` har ingen */
/* direkte clubhouse-kilde og er avledet (alfa-blandet) fra clubhouse   */
/* sine etablerte farger, kontrastsjekket mot originalens egne          */
/* verdier (aldri under dem) -- ikke fritt oppfunnet.                   */
/* ------------------------------------------------------------------ */
:root {
  --nr-bg: #f3f6ec;
  --nr-surface: #ffffff;
  --nr-surface-2: #f7f9f3;
  --nr-ink: #17200f;
  --nr-muted: #515b45;
  --nr-faint: #828a77;
  --nr-border: #dbe1cd;
  --nr-border-strong: #969d8a;
  --nr-accent: #2f6b1e;
  --nr-accent-ink: #ffffff;
  --nr-accent-soft: #e4eed6;
  --nr-accent-ring: #9bb78f;
  --nr-danger: #b42318;
  --nr-danger-soft: #fdeceb;
  --nr-ok: #1f7a44;
  --nr-ok-soft: #e6f4ec;
}

.dark {
  --nr-bg: #131a0f;
  --nr-surface: #1d2616;
  --nr-surface-2: #26301d;
  --nr-ink: #eef3e6;
  --nr-muted: #a7b598;
  --nr-faint: #7b866f;
  --nr-border: #34402a;
  --nr-border-strong: #757f6c;
  --nr-accent: #3c8226;
  --nr-accent-ink: #ffffff;
  --nr-accent-soft: #2d3b1e;
  --nr-accent-ring: #2a531c;
  --nr-danger: #ca655d;
  --nr-danger-soft: #382516;
  --nr-ok: #6da985;
  --nr-ok-soft: #1d371f;
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    --nr-bg: #131a0f;
    --nr-surface: #1d2616;
    --nr-surface-2: #26301d;
    --nr-ink: #eef3e6;
    --nr-muted: #a7b598;
    --nr-faint: #7b866f;
    --nr-border: #34402a;
    --nr-border-strong: #757f6c;
    --nr-accent: #3c8226;
    --nr-accent-ink: #ffffff;
    --nr-accent-soft: #2d3b1e;
    --nr-accent-ring: #2a531c;
    --nr-danger: #ca655d;
    --nr-danger-soft: #382516;
    --nr-ok: #6da985;
    --nr-ok-soft: #1d371f;
  }
}
