/* Base : couleurs, typographie, boutons, cartes, animations communes. */

:root {
  --ink: #0d0f2b;
  --cobalt: #2339e6;
  --cobalt-light: #2d45f5;
  --white: #ffffff;
  --panel: #eef1ff;
  --yellow: #ffd62e;
  --red: #e5214f;
  --font-display: "Big Shoulders Display", "Impact", "Arial Narrow", sans-serif;
  --font-body: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 20px;
  --border: 3px solid var(--ink);
  --shadow: 0 5px 0 var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  min-height: 100%;
  background-color: var(--cobalt);
  /* Bandes de pelouse tondue, sur html : elles couvrent toute la page et la zone « élastique » d'iOS, quelle que soit la hauteur.
     Les bandes sont verticales : le motif ne dépend pas de la hauteur, donc pas besoin de background-attachment: fixed (cassé sur Safari iOS). */
  background-image: repeating-linear-gradient(90deg, var(--cobalt) 0 56px, var(--cobalt-light) 56px 112px);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.4;
  color: var(--ink);
  background: transparent; /* le fond rayé est sur html */
}

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

.screen {
  width: 100%;
  max-width: 30rem;
  margin: 0 auto;
  padding: 16px 16px calc(32px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- Cartes ---------- */
.card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.card__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 12px;
}

/* ---------- Boutons ---------- */
.btn {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: var(--yellow);
  border: var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  padding: 0.6em 1.4em;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn--block { width: 100%; }
.btn--big { font-size: 1.9rem; padding: 0.55em 1em; }
.btn--small { font-size: 1.1rem; padding: 0.4em 1em; box-shadow: 0 3px 0 var(--ink); }
.btn--ghost { background: var(--white); }

.link-btn {
  font: inherit;
  font-weight: 700;
  color: var(--white);
  background: none;
  border: 0;
  padding: 8px;
  text-decoration: underline;
  cursor: pointer;
}
.link-btn--dark { color: var(--ink); padding: 0; }

:focus-visible { outline: 4px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 7px var(--white); }

/* ---------- Pop-up (indices, abandon) ---------- */
.modal {
  width: min(24rem, calc(100vw - 32px));
  padding: 24px 20px;
  color: var(--ink);
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 0 var(--ink);
  animation: modal-in 0.25s cubic-bezier(0.2, 1.3, 0.5, 1);
}
.modal::backdrop { background: rgba(13, 15, 43, 0.72); backdrop-filter: blur(3px); animation: fade-in 0.2s; }
.modal__title { font-family: var(--font-display); font-weight: 900; font-size: 2rem; line-height: 1; }
.modal__text { margin: 8px 0 20px; font-weight: 700; font-size: 1.15rem; }
.modal__actions { display: flex; gap: 12px; }
.modal__actions .btn { flex: 1; font-size: 1.25rem; padding-inline: 0.6em; }

/* ---------- Petits messages ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  font-weight: 800;
  text-align: center;
  color: var(--white);
  background: var(--ink);
  border-radius: 999px;
  z-index: 60;
  animation: toast-in 0.3s both;
}
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }
.noscript { padding: 24px; color: var(--white); font-weight: 700; }

/* ---------- Mode test : pastille discrète en bas à gauche ---------- */
.test-panel { position: fixed; left: 8px; bottom: 8px; z-index: 20; }
.test-panel summary { display: grid; place-items: center; width: 34px; height: 34px; list-style: none; cursor: pointer; background: var(--ink); border-radius: 50%; opacity: 0.7; }
.test-panel summary::-webkit-details-marker { display: none; }
.test-panel__body { position: absolute; left: 0; bottom: 44px; width: min(20rem, calc(100vw - 16px)); display: flex; flex-direction: column; gap: 10px; background: var(--panel); }
.test-panel__row { display: flex; gap: 8px; flex-wrap: wrap; }
.test-panel input { flex: 1; min-width: 9rem; font: inherit; padding: 6px 10px; border: 2px solid var(--ink); border-radius: 10px; }

/* ---------- Étiquette discrète « Points x1,5 » ---------- */
.multiplier-tag {
  display: inline-block;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink);
  background: var(--yellow);
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- Animations ---------- */
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(24px) scale(0.92); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px); } }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}
.is-shaking { animation: shake 0.4s; border-color: var(--red) !important; }

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