/* Brain Arcade — shared theme variables + dark/light + colour theme picker widget.
   Loaded before each app's own stylesheet so app styles can override. */

:root {
  --theme-primary: #1b3a6b;
  --theme-accent: #f5a623;
  --theme-primary-dark: color-mix(in srgb, var(--theme-primary) 75%, black);
  --theme-accent-dark: color-mix(in srgb, var(--theme-accent) 80%, black);

  --bg-outer-1: var(--theme-primary);
  --bg-outer-2: var(--theme-primary-dark);
  --hub-bg: #f4f7fb;
  --surface: #ffffff;
  --surface-alt: #f4f7fb;
  --text-primary: #1b3a6b;
  --text-secondary: #555555;
  --subtitle-color: var(--theme-accent-dark);
  --border-color: rgba(0, 0, 0, 0.12);
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  --control-bg: rgba(255, 255, 255, 0.85);
}

html[data-theme="dark"] {
  --bg-outer-1: var(--theme-primary);
  --bg-outer-2: color-mix(in srgb, var(--theme-primary) 35%, black);
  --hub-bg: #1a212c;
  --surface: #262f3d;
  --surface-alt: #1a212c;
  --text-primary: #f4f7fb;
  --text-secondary: #b7c0cc;
  --subtitle-color: color-mix(in srgb, var(--theme-accent) 90%, white);
  --border-color: rgba(255, 255, 255, 0.14);
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  --control-bg: rgba(38, 47, 61, 0.85);
}

/* ---------- Colour themes ---------- */
/* National colours */
html[data-color-theme="canada"]     { --theme-primary: #FF0000; --theme-accent: #ffffff; }
html[data-color-theme="england"]    { --theme-primary: #CF142B; --theme-accent: #ffffff; }
html[data-color-theme="argentina"]  { --theme-primary: #74ACDF; --theme-accent: #ffffff; }
/* Football clubs */
html[data-color-theme="arsenal"]    { --theme-primary: #EF0107; --theme-accent: #ffffff; }
html[data-color-theme="chelsea"]    { --theme-primary: #034694; --theme-accent: #ffffff; }
html[data-color-theme="manutd"]     { --theme-primary: #DA291C; --theme-accent: #FBE122; }
html[data-color-theme="mancity"]    { --theme-primary: #6CABDD; --theme-accent: #ffffff; }
html[data-color-theme="liverpool"]  { --theme-primary: #C8102E; --theme-accent: #F6EB61; }
html[data-color-theme="realmadrid"] { --theme-primary: #00529F; --theme-accent: #FEBE10; }
html[data-color-theme="barcelona"]  { --theme-primary: #004D98; --theme-accent: #A50044; }
html[data-color-theme="psg"]        { --theme-primary: #003070; --theme-accent: #ED2939; }

/* ---------- Theme controls widget (injected by theme.js) ---------- */
#ba-theme-widget {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  z-index: 1000;
  background: var(--control-bg);
  border-radius: 16px;
  padding: 8px 10px;
  box-shadow: var(--shadow);
}
#ba-theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--theme-primary);
  background: var(--surface);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
#ba-theme-swatches {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 180px;
}
.ba-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.ba-swatch.selected {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text-primary);
}
