/* Mêmes couleurs que l'appli Android (Theme.kt), en clair et en sombre */
@font-face {
  font-family: "Manrope";
  src: url("manrope.ttf?v=1") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --fond: #F6F4F1;
  --surface: #FFFFFF;
  --surface2: #EFECE8;
  --trait: #E6E2DD;
  --texte: #16181C;
  --texte2: #6B6F76;
  --texte3: #A3A6AC;
  --biere: #0FA97A;
  --biere-doux: #DDF5EC;
  --gainage: #FF6B3D;
  --gainage-doux: #FFE6DC;
  --danger: #E5484D;
  --danger-doux: #FDE4E4;
  --sur-accent: #FFFFFF;
  /* couleurs des défis (forte, douce), comme Theme.kt */
  --a0: #0FA97A; --a0d: #DDF5EC;
  --a1: #FF6B3D; --a1d: #FFE6DC;
  --a2: #2F7CF6; --a2d: #E0ECFE;
  --a3: #D99A00; --a3d: #FBF0D2;
  --a4: #E0457B; --a4d: #FCE3EC;
  --a5: #0B9DB0; --a5d: #D9F3F6;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0E0F12;
    --surface: #18191D;
    --surface2: #222328;
    --trait: #2A2C31;
    --texte: #F3F3F5;
    --texte2: #9EA1A8;
    --texte3: #63666D;
    --biere: #34D399;
    --biere-doux: #12322A;
    --gainage: #FF8A5C;
    --gainage-doux: #3A2219;
    --danger: #FF6B6F;
    --danger-doux: #3A1D1F;
    --sur-accent: #0E0F12;
    --a0: #34D399; --a0d: #12322A;
    --a1: #FF8A5C; --a1d: #3A2219;
    --a2: #6AA5FF; --a2d: #172840;
    --a3: #FBC24A; --a3d: #3A2F12;
    --a4: #F472A6; --a4d: #3A1A28;
    --a5: #3FD4E6; --a5d: #0F3238;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 500 16px/1.5 "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
}

header {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 600px;
  margin: 0 auto;
  padding: 32px 20px 12px;
}
header img { border-radius: 14px; }
header h1 { margin: 0; font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }

.etiquette {
  margin: 0;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--texte2);
}

main {
  max-width: 600px;
  margin: 0 auto;
  padding: 12px 20px 48px;
  display: grid;
  gap: 16px;
}

.carte {
  background: var(--surface);
  border-radius: 28px;
  padding: 24px;
  animation: apparait .5s cubic-bezier(.2, .8, .2, 1) both;
}
.carte:nth-child(2) { animation-delay: .08s; }
.carte h2 { margin: 0 0 6px; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.carte p { margin: 8px 0; }

@keyframes apparait {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.discret { color: var(--texte2); font-size: .92rem; }
.erreur { color: var(--danger); min-height: 1.2em; margin: 6px 0 0; }

.bouton {
  display: inline-block;
  background: var(--texte);
  color: var(--fond);
  border: 0;
  border-radius: 999px;
  padding: 15px 28px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease;
}
.bouton:active { transform: scale(.96); }
#telecharger { background: var(--gainage); color: var(--sur-accent); margin-top: 8px; }

input {
  width: 100%;
  padding: 14px 18px;
  margin: 6px 0 12px;
  border-radius: 18px;
  border: 1.5px solid var(--trait);
  background: var(--surface);
  color: var(--texte);
  font: inherit;
  outline: none;
  transition: border-color .2s;
}
input:focus { border-color: var(--texte); }

details { margin-top: 14px; }
summary { cursor: pointer; font-weight: 700; color: var(--texte2); }
ol { padding-left: 1.3em; color: var(--texte2); }
li { margin: 8px 0; }
code { background: var(--surface2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }

.chiffres {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 14px 0 16px;
}
.chiffre {
  background: var(--fond);
  border-radius: 22px;
  padding: 16px 18px;
  animation: apparait .5s cubic-bezier(.2, .8, .2, 1) both;
}
.chiffre:nth-child(2) { animation-delay: .05s; }
.chiffre:nth-child(3) { animation-delay: .1s; }
.chiffre:nth-child(4) { animation-delay: .15s; }
.chiffre:nth-child(5) { animation-delay: .2s; }
.chiffre:nth-child(6) { animation-delay: .25s; }
.chiffre b { display: block; font-size: 2.1rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.chiffre span { color: var(--texte2); font-size: .88rem; }
.chiffre.biere { background: var(--biere-doux); }
.chiffre.biere b { color: var(--biere); }
.chiffre.gainage { background: var(--gainage-doux); }
.chiffre.gainage b { color: var(--gainage); }

.grille {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px 4px;
  margin: 14px 0;
}
.grille .jour {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--texte2);
}
.grille .jour span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.grille .entete { font-size: .72rem; color: var(--texte3); }
.grille .ok span { background: var(--biere-doux); color: var(--biere); }
.grille .rate span { background: var(--danger-doux); color: var(--danger); }
.grille .auj span { box-shadow: inset 0 0 0 2px var(--texte); }
.grille .futur { opacity: .4; }

.pt { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.pt.fait { background: var(--gainage); }
.pt.joker { background: var(--texte3); }
.pastille { display: inline-block; width: 14px; height: 14px; border-radius: 50%; }
.pastille.ok { background: var(--biere-doux); }
.pastille.rate { background: var(--danger-doux); }

.legende { display: flex; flex-wrap: wrap; gap: 16px; color: var(--texte2); font-size: .85rem; }
.legende span { display: inline-flex; align-items: center; gap: 6px; }

.lien { background: none; border: 0; color: var(--texte3); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  .carte, .chiffre { animation: none; }
}

#bouton-google { min-height: 44px; margin: 8px 0; }
footer { text-align: center; padding: 0 20px 40px; }
footer a, .lien-discret { color: var(--texte3); font-size: .9rem; }
.defi { background: var(--fond); border-radius: 22px; padding: 18px; margin: 12px 0; }
.defi-tete { display: flex; align-items: baseline; gap: 10px; }
.defi-tete b { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.defi-tete span { color: var(--texte2); }
.defi h3 { margin: 0 0 8px; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.defi .grille { margin: 12px 0 4px; }
.grille .fait span { color: #fff; }
.compte { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.compte .actions { display: flex; gap: 14px; }
.danger { color: var(--danger) !important; }
.defi h3, .defi-tete b { color: var(--c); }
.defi .ok span { background: var(--cd); color: var(--c); }
.defi .fait span { background: var(--c); }
.defi .joker span { background: var(--surface2); }

/* Page des stats de l'appli (stats.html) */
.histo { position: relative; margin: 6px 0 4px; }
.histo-max { position: absolute; top: -2px; left: 0; font-size: .75rem; color: var(--texte3); }
.barres { display: flex; align-items: flex-end; gap: 2px; height: 120px; padding-top: 18px; border-bottom: 1px solid var(--trait); }
.barre { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.barre span { width: 100%; min-height: 0; background: var(--gainage); border-radius: 4px 4px 0 0; }
.barre:hover span { background: var(--texte); }
.histo-axe { display: flex; justify-content: space-between; font-size: .75rem; color: var(--texte3); margin-top: 4px; }
.versions { display: flex; flex-wrap: wrap; gap: 8px; }
.versions span { background: var(--fond); border-radius: 999px; padding: 4px 12px; font-size: .88rem; color: var(--texte2); }
.versions b { color: var(--texte); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: 8px; }
td { padding: 4px 0; border-bottom: 1px solid var(--trait); color: var(--texte2); }
td:last-child { text-align: right; color: var(--texte); font-weight: 700; }
