/* Variables globales + reset doux, pense pour tablette et grands boutons */

/* Police embarquee (licence libre OFL, voir fonts/OFL.txt) : aucune
   ressource externe n'est chargee. Police variable, graisses 400 a 800. */
@font-face {
  font-family: "Baloo 2";
  src: url("../fonts/Baloo2.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-bg: #f3f6fb;
  --color-surface: #ffffff;
  --color-border: #dfe6ef;
  --color-text: #1f2933;
  --color-text-soft: #52606d;
  --color-primary: #3d7cff;
  --color-primary-contrast: #ffffff;
  --color-success: #23945c;
  --color-success-soft: #e3f7ec;
  --color-danger: #d9483d;
  --color-danger-soft: #fdecea;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-soft: 0 6px 20px rgba(31, 41, 51, 0.10);
  /* Relief "bouton de jouet" : une bordure basse plus sombre qui s'ecrase au clic */
  --relief: 0 5px 0 rgba(31, 41, 51, 0.14);
  --relief-pressed: 0 1px 0 rgba(31, 41, 51, 0.14);
  --touch-target: 72px;
  --font-family: "Baloo 2", "Comic Sans MS", "Segoe UI Rounded", system-ui, sans-serif;

  /* Surchargees dynamiquement par themes-loader.js selon le theme actif */
  --theme-primary: var(--color-primary);
  --theme-secondary: #ffffff;
  --theme-accent: #ffcc00;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background:
    radial-gradient(circle at 10% 0%, #e4edff 0, transparent 40%),
    radial-gradient(circle at 90% 100%, #fff1d6 0, transparent 45%),
    var(--color-bg);
  background-attachment: fixed;
  color: var(--color-text);
  font-size: 20px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

h1, h2, h3 {
  margin: 0 0 0.4em 0;
  line-height: 1.2;
  font-weight: 800;
}

p {
  margin: 0 0 0.6em 0;
  color: var(--color-text-soft);
}

button {
  font-family: inherit;
  font-size: 1em;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-md);
  min-height: var(--touch-target);
  min-width: var(--touch-target);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--relief), var(--shadow-soft);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

button:active {
  transform: translateY(4px);
  box-shadow: var(--relief-pressed), var(--shadow-soft);
}

button:focus-visible {
  outline: 4px solid var(--color-primary);
  outline-offset: 3px;
}

button.primary {
  background: var(--theme-primary, var(--color-primary));
  color: var(--color-primary-contrast);
}

button.ghost {
  background: transparent;
  box-shadow: none;
}

button.ghost:active {
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

input {
  font-family: inherit;
  font-size: 1.1em;
  padding: 0.5em;
  border-radius: var(--radius-sm);
  border: 2px solid #d9e2ec;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
