/* Shared colours and base rules. Page layouts live in home.css and practice.css.
   Every page is sized in rem, and each layout file sets the root font size from
   the viewport so the whole page scales to fit one screen without scrolling. */
:root {
  --bg: #f4f7f6;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-light: #dbeafe;
  --primary-dark: #1d4ed8;
  --on-primary: #ffffff;
  --accent: #d97706;
  --accent-light: #fef3c7;
  --accent-text: #92400e;
  --gold: #b45309;
  --success: #16a34a;
  --success-light: #dcfce7;
  --success-text: #15803d;
  --error: #dc2626;
  --error-light: #fee2e2;
  --border: #cbd5e1;
  --surface-2: #f8fafc;
  --field-bg: #ffffff;
  --highlight: #f1f5f9;
  --candidate: #fffbeb;
  --icon-bg: #dbeafe;
  color-scheme: light;
}

/* Dark theme: chosen explicitly, or by the device when the theme is left on "system".
   js/theme.js sets data-theme on <html>; no attribute means follow the system. */
:root[data-theme="dark"] {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #60a5fa;
  --primary-light: #1e3a5f;
  --primary-dark: #3b82f6;
  --on-primary: #0b1220;
  --accent: #f59e0b;
  --accent-light: #422006;
  --accent-text: #fcd34d;
  --gold: #fbbf24;
  --success: #22c55e;
  --success-light: #14532d;
  --success-text: #86efac;
  --error: #f87171;
  --error-light: #7f1d1d;
  --border: #475569;
  --surface-2: #263449;
  --field-bg: #0b1220;
  --highlight: #334155;
  --candidate: #3a2f12;
  --icon-bg: #bfdbfe;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f172a;
    --card: #1e293b;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --primary: #60a5fa;
    --primary-light: #1e3a5f;
    --primary-dark: #3b82f6;
    --on-primary: #0b1220;
    --accent: #f59e0b;
    --accent-light: #422006;
    --accent-text: #fcd34d;
    --gold: #fbbf24;
    --success: #22c55e;
    --success-light: #14532d;
    --success-text: #86efac;
    --error: #f87171;
    --error-light: #7f1d1d;
    --border: #475569;
    --surface-2: #263449;
    --field-bg: #0b1220;
    --highlight: #334155;
    --candidate: #3a2f12;
    --icon-bg: #bfdbfe;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--primary); }
button { font: inherit; }
