/* Sur la route avec Joe — mobile first 390px */
:root {
  --parchemin: #F5EAD0;
  --parchemin-2: #FBF3E0;
  --rouge: #B01E24;
  --marine: #0C1E4A;
  --bleu: #1658C4;
  --turquoise: #00B8C5;
  --or: #F5B81E;
  --vert: #2E6B3A;
  --gris-brun: #6B5E4E;
  --ombre: 0 4px 0 rgba(12, 30, 74, 0.18);
  --font-ui: "Barlow", system-ui, sans-serif;
  --font-titre: "Libre Baskerville", "Times New Roman", serif;
  --font-peint: "Caveat", cursive;
  --col-max: 480px;
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-ui);
  color: var(--marine);
  background: var(--parchemin);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  background-color: var(--parchemin);
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(255,255,255,.35), transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(180,140,80,.12), transparent 45%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.85 0 0 0 0 0.78 0 0 0 0 0.62 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  border: 0;
}

.desktop-decor { display: none; }

.app {
  position: relative;
  width: 100%;
  max-width: var(--col-max);
  margin: 0 auto;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  min-height: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  padding: clamp(0.25rem, 1dvh, 0.55rem) clamp(0.75rem, 3.5vw, 1.1rem) clamp(0.35rem, 1.2dvh, 0.7rem);
  overflow: hidden;
  position: relative;
  width: 100%;
}

.screen.is-active {
  display: flex;
}

.screen[hidden] { display: none !important; }
.screen.is-active[hidden] { display: flex !important; }

/* —— Titres peints —— */
.brand-title {
  margin: 0;
  line-height: 1.05;
  flex: 1;
}

.brand-line1 {
  display: block;
  font-family: var(--font-peint);
  font-size: clamp(1.35rem, 5.5vw, 1.7rem);
  font-weight: 700;
  color: var(--marine);
  text-shadow: 0 0 2px #fff, 1px 1px 0 #fff;
}

.brand-line2 {
  display: block;
  font-family: var(--font-peint);
  font-size: clamp(1.1rem, 4.5vw, 1.35rem);
  color: var(--marine);
  text-shadow: 0 0 2px #fff;
}

.brand-joe {
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: clamp(1.85rem, 8vw, 2.45rem);
  color: var(--rouge);
  letter-spacing: -0.02em;
  text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, 0 0 3px #fff;
  position: relative;
}

.brand-joe::before {
  content: "♛";
  position: absolute;
  top: -0.45em;
  left: 0.05em;
  font-size: 0.38em;
  color: var(--or);
  transform: rotate(-18deg);
  text-shadow: none;
}

.accueil-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
  flex-shrink: 0;
}

.ludik-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--marine);
  line-height: 1.1;
  text-align: center;
  flex-shrink: 0;
}

.fleur-logo { width: 22px; height: 26px; }

/* —— Joe + bulle —— */
.joe-row {
  display: flex;
  align-items: flex-start;
  width: 100%;
  gap: 0.4rem;
  flex: 0 1 auto;
  min-height: 0;
  margin-top: 0.2rem;
}

.joe-row-compact { margin-top: 0.35rem; }

.joe-img {
  width: clamp(64px, 18vw, 96px);
  height: auto;
  max-height: 18dvh;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(1px 2px 0 rgba(12,30,74,.12));
}

.joe-sm {
  width: clamp(64px, 18vw, 88px);
  max-height: 18dvh;
}

.bubble {
  position: relative;
  background: #fffef8;
  border: 2px solid var(--marine);
  border-radius: 1.4rem;
  padding: 0.55rem 0.75rem;
  margin-top: 0.8rem;
  box-shadow: 2px 3px 0 rgba(12,30,74,.1);
  flex: 1;
  min-width: 0;
}

.bubble::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 1.1rem;
  width: 14px;
  height: 14px;
  background: #fffef8;
  border-left: 2px solid var(--marine);
  border-bottom: 2px solid var(--marine);
  transform: rotate(45deg);
}

.bubble p {
  margin: 0;
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: clamp(0.95rem, 3.8vw, 1.15rem);
  color: var(--marine);
  text-align: center;
  line-height: 1.25;
}

.bubble-defi p {
  text-decoration: underline;
  text-decoration-color: var(--rouge);
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

/* —— Rubans —— */
.ribbon {
  position: relative;
  width: 100%;
  max-width: 100%;
  background: var(--marine);
  color: #fff;
  text-align: center;
  padding: 0.35rem 1.4rem;
  margin: 0.3rem 0 0.2rem;
  clip-path: polygon(0 8%, 2% 0, 98% 0, 100% 8%, 100% 92%, 98% 100%, 2% 100%, 0 92%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-shrink: 0;
  box-shadow: 0 3px 0 rgba(12,30,74,.25);
}

.ribbon-red { background: var(--rouge); }

.ribbon-top { margin-top: 0.15rem; }

.ribbon-text {
  font-family: var(--font-peint);
  font-size: clamp(1.15rem, 4.8vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 0 3px rgba(255,255,255,.5), 1px 1px 0 rgba(0,0,0,.15);
}

.fleur {
  width: 14px;
  height: 16px;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 28'%3E%3Cpath fill='%23fff' d='M12 2c.4 2.2-.2 3.8-1.4 5.2 1.6-.4 3-.2 4.2.8-.6-1.8-.2-3.6 1.2-5.2C13.8 4.2 12.8 5.6 12 2zm0 6.5c-2.8 1.2-4.6 3.4-5 6.2 1.8-1.2 3.6-1.6 5.4-1.2-1.2 1.6-1.6 3.4-1 5.5.8-2 2.2-3.4 4-4.2-.2 2 .4 3.8 1.8 5.2.4-2.8-.2-5.2-1.8-7 1.8.2 3.4 1 4.6 2.4-.8-2.6-2.6-4.6-5.2-5.6 1.6-.2 3-.8 4.2-2-2.2.4-4 .2-5.6-.8.8 1.6.6 3.2-.4 4.5z'/%3E%3C/svg%3E");
  flex-shrink: 0;
}

.etape-block {
  text-align: center;
  flex-shrink: 0;
  margin: 0.15rem 0;
}

.etape-compact { margin-top: 0.25rem; }

.etape-label {
  margin: 0;
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: clamp(0.95rem, 3.6vw, 1.1rem);
  color: var(--rouge);
  text-shadow: 0 0 2px #fff;
}

.etape-trajet {
  margin: 0.1rem 0 0;
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: clamp(1.05rem, 4.2vw, 1.25rem);
  color: var(--marine);
}

/* —— Carte —— */
.carte-trajet {
  width: 100%;
  flex: 1 1 auto;
  min-height: 7dvh;
  max-height: 15dvh;
  background:
    linear-gradient(180deg, rgba(245,234,208,.2), rgba(245,234,208,.55)),
    radial-gradient(ellipse at 30% 60%, #a8d0e8 0%, transparent 55%),
    radial-gradient(ellipse at 70% 40%, #c5d9a8 0%, transparent 50%),
    linear-gradient(160deg, #d9e8c8, #e8d5b0 60%, #c8dce8);
  border-radius: 0.75rem;
  border: 1.5px solid rgba(12,30,74,.15);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.15rem 0;
}

.carte-compact { max-height: 12dvh; }

.carte-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* —— Boutons —— */
.btn {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: clamp(1rem, 4vw, 1.15rem);
  border: none;
  cursor: pointer;
  border-radius: 999px;
  min-height: 48px;
  padding: 0.55rem 1.2rem;
  width: 100%;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-shrink: 0;
  transition: transform .12s ease, filter .12s ease;
}

.btn:active { transform: translateY(2px); }

.btn-primary {
  background: var(--rouge);
  color: #fff;
  box-shadow: var(--ombre);
  margin-top: 0.35rem;
}

.btn-secondary {
  background: var(--marine);
  color: #fff;
  box-shadow: var(--ombre);
  font-size: clamp(0.85rem, 3.2vw, 0.95rem);
  padding: 0.65rem 0.5rem;
}

.btn-outline {
  background: #fff;
  color: var(--marine);
  border: 2px solid var(--marine);
  box-shadow: none;
  font-size: clamp(0.85rem, 3.2vw, 0.95rem);
  padding: 0.65rem 0.5rem;
}

.btn-small {
  width: auto;
  min-width: 6.5rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.95rem;
  min-height: 44px;
}

.btn-share img { filter: brightness(0) invert(1); }

.meta-line {
  margin: 0.35rem 0 0.2rem;
  font-size: clamp(0.72rem, 2.8vw, 0.82rem);
  color: var(--marine);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.meta-dashes {
  display: inline-block;
  width: 1.6rem;
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    var(--rouge) 0 4px,
    transparent 4px 7px
  );
}

.footer-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  width: 100%;
  margin-top: auto;
  padding-top: 0.2rem;
  padding-bottom: 0.15rem;
  flex-shrink: 0;
  background: linear-gradient(180deg, transparent, var(--parchemin) 30%);
}

.nav-link {
  background: none;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--marine);
  cursor: pointer;
  padding: 0.35rem;
  min-height: 44px;
}

.nav-link img { width: 22px; height: auto; }

.nav-sep {
  width: 1px;
  height: 1.4rem;
  background: rgba(12,30,74,.35);
}

/* —— Quiz —— */
.progress {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin: 0.5rem 0 0.7rem;
  flex-shrink: 0;
}

.progress-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(88%, 280px);
  position: relative;
}

.progress-track::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 2px;
  background: rgba(176, 30, 36, 0.35);
  z-index: 0;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #c4b08a;
  background: var(--parchemin);
  position: relative;
  z-index: 1;
}

.dot.is-filled {
  background: var(--rouge);
  border-color: var(--rouge);
}

.progress-fleur {
  width: 16px;
  height: 18px;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 28'%3E%3Cpath fill='%23B01E24' d='M12 2c.4 2.2-.2 3.8-1.4 5.2 1.6-.4 3-.2 4.2.8-.6-1.8-.2-3.6 1.2-5.2C13.8 4.2 12.8 5.6 12 2zm0 6.5c-2.8 1.2-4.6 3.4-5 6.2 1.8-1.2 3.6-1.6 5.4-1.2-1.2 1.6-1.6 3.4-1 5.5.8-2 2.2-3.4 4-4.2-.2 2 .4 3.8 1.8 5.2.4-2.8-.2-5.2-1.8-7 1.8.2 3.4 1 4.6 2.4-.8-2.6-2.6-4.6-5.2-5.6 1.6-.2 3-.8 4.2-2-2.2.4-4 .2-5.6-.8.8 1.6.6 3.2-.4 4.5z'/%3E%3C/svg%3E");
}

.question-card {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,252,245,.65);
  border: 1.5px dashed rgba(12,30,74,.2);
  border-radius: 0.75rem;
  padding: 1rem 0.85rem;
  margin-bottom: 0.65rem;
}

.question-text {
  margin: 0;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: clamp(1.05rem, 4.4vw, 1.25rem);
  color: var(--marine);
  text-align: center;
  line-height: 1.3;
}

.field {
  width: 100%;
  min-height: 48px;
  border: 2px solid var(--bleu);
  border-radius: 0.55rem;
  background: #fff;
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--marine);
  padding: 0.65rem 0.85rem;
  outline: none;
  flex-shrink: 0;
}

.field:focus { border-color: var(--marine); box-shadow: 0 0 0 2px rgba(22,88,196,.2); }

.field-answer { margin-bottom: 0.35rem; }

/* —— Résultat Q —— */
.gain-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  margin: 0.35rem 0;
  flex: 0 1 auto;
  min-height: 0;
}

.animal-badge {
  width: clamp(90px, 28vw, 120px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.12));
}

.km-badge {
  position: relative;
  background: var(--vert);
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: clamp(1.15rem, 4.5vw, 1.4rem);
  padding: 0.55rem 1rem;
  border-radius: 50% 40% 55% 45% / 45% 55% 40% 60%;
  box-shadow: 0 3px 0 rgba(20,60,30,.3);
}

.km-rays {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 10px;
  background:
    linear-gradient(90deg, transparent 40%, #e88a2a 40% 48%, transparent 48%),
    linear-gradient(105deg, transparent 40%, #e88a2a 40% 48%, transparent 48%),
    linear-gradient(75deg, transparent 40%, #e88a2a 40% 48%, transparent 48%);
}

.mini-course {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 16dvh;
  background:
    linear-gradient(180deg, rgba(245,234,208,.3), rgba(245,234,208,.7)),
    linear-gradient(180deg, #b8d4e8, #c8dcb0);
  border-radius: 0.75rem;
  border: 1.5px solid rgba(12,30,74,.12);
  display: flex;
  align-items: center;
  padding: 0.6rem 1rem;
  margin: 0.25rem 0 0.4rem;
}

.course-track {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 4.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
}

.course-track::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 42%;
  border-top: 3px dashed var(--rouge);
  opacity: .85;
}

.course-marker {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  font-weight: 700;
  font-size: 0.85rem;
}

.course-toi { transform: translateY(-0.4rem); }
.course-joe { transform: translateY(0.15rem); }

.pin {
  width: 28px;
  height: 34px;
  display: block;
}

.pin-toi {
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 34'%3E%3Cpath fill='%232E6B3A' stroke='%23fff' stroke-width='1.5' d='M14 1c6 0 11 5 11 11 0 8-11 21-11 21S3 20 3 12C3 6 8 1 14 1z'/%3E%3Cpath fill='%23fff' d='M14 7c.2 1.2-.1 2-0.7 2.8.8-.2 1.6-.1 2.2.4-.3-1-.1-2 .6-2.8-.9.7-1.5 1.4-2.1.0zm0 3.4c-1.5.6-2.4 1.8-2.6 3.2.9-.6 1.9-.8 2.8-.6-.6.8-.8 1.8-.5 2.9.4-1 1.1-1.8 2.1-2.2-.1 1 .2 2 .9 2.7.2-1.5-.1-2.7-.9-3.6.9.1 1.8.5 2.4 1.3-.4-1.4-1.4-2.4-2.7-2.9.8-.1 1.6-.4 2.2-1-1.1.2-2.1.1-2.9-.4.4.8.3 1.7-.2 2.4z'/%3E%3C/svg%3E");
}

.pin-joe {
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 34'%3E%3Cpath fill='%23B01E24' stroke='%23fff' stroke-width='1.5' d='M14 1c6 0 11 5 11 11 0 8-11 21-11 21S3 20 3 12C3 6 8 1 14 1z'/%3E%3Cpath fill='%23F5B81E' d='M9 10l2-3 3 1 3-1 2 3-1.5 1.5H10.5z'/%3E%3Crect x='10' y='11' width='8' height='3' rx='.5' fill='%23F5B81E'/%3E%3C/svg%3E");
}

.course-name { color: var(--marine); }
.course-km { color: var(--gris-brun); font-size: 0.78rem; font-weight: 600; }

/* —— Final —— */
.crown-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: -0.35rem;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.crown-icon {
  width: clamp(40px, 12vw, 52px);
  height: auto;
  transform: rotate(12deg);
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.2));
}

.section-title, .page-title {
  font-family: var(--font-titre);
  font-size: clamp(1.05rem, 4vw, 1.2rem);
  color: var(--rouge);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 0.35rem 0;
  flex-shrink: 0;
  width: 100%;
}

.page-title {
  color: var(--marine);
  font-family: var(--font-peint);
  font-size: clamp(1.55rem, 6vw, 1.9rem);
  text-shadow: 0 0 2px #fff;
  margin-top: 0.25rem;
}

.title-dash {
  width: 1.4rem;
  height: 2px;
  background: var(--rouge);
}

.title-marks {
  width: 18px;
  height: 14px;
  background:
    linear-gradient(135deg, var(--rouge) 0 2px, transparent 2px) 0 2px / 8px 8px no-repeat,
    linear-gradient(135deg, var(--rouge) 0 2px, transparent 2px) 5px 0 / 8px 8px no-repeat,
    linear-gradient(135deg, var(--rouge) 0 2px, transparent 2px) 10px 4px / 8px 8px no-repeat;
}

.animaux-row {
  display: flex;
  justify-content: center;
  gap: clamp(0.4rem, 3vw, 1rem);
  width: 100%;
  flex: 0 1 auto;
  min-height: 0;
  margin: 0.15rem 0 0.35rem;
}

.animaux-row img {
  width: clamp(70px, 22vw, 92px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.12));
}

.score-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1rem;
  margin: 0.2rem 0 0.35rem;
  flex-shrink: 0;
  width: 100%;
}

.score-badge {
  background: var(--bleu);
  color: #fff;
  font-weight: 800;
  padding: 0.35rem 0.9rem;
  border-radius: 40% 50% 45% 55% / 50% 40% 60% 45%;
  box-shadow: 0 2px 0 rgba(12,30,74,.25);
}

.link-blue {
  background: none;
  border: none;
  color: var(--bleu);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  margin-top: 0.35rem;
  min-height: 40px;
  flex-shrink: 0;
}

/* —— Ligues —— */
.btn-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  width: 100%;
  margin: 0.4rem 0 0.55rem;
  flex-shrink: 0;
}

.form-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex-shrink: 0;
}

.form-block label {
  font-weight: 700;
  font-size: 0.92rem;
  margin-top: 0.25rem;
}

.invite-box {
  width: 100%;
  background: rgba(220, 200, 160, 0.35);
  border: 1.5px solid rgba(12,30,74,.12);
  border-radius: 0.75rem;
  padding: 0.65rem 0.75rem;
  margin: 0.55rem 0;
  flex-shrink: 0;
}

.invite-title {
  margin: 0 0 0.45rem;
  font-weight: 800;
  font-size: 0.95rem;
}

.invite-row {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.invite-row .field {
  flex: 1;
  min-width: 0;
  color: var(--gris-brun);
  font-weight: 500;
}

.compte-hint {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--marine);
  width: 100%;
  margin: 0.15rem 0 0.25rem;
  flex-shrink: 0;
}

/* —— Ligue privée —— */
.groupe-top {
  margin: 0.1rem 0 -0.15rem;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,.5));
}

.code-box {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: rgba(255,250,240,.7);
  border: 1.5px solid rgba(107,94,78,.35);
  border-radius: 0.65rem;
  padding: 0.45rem 0.55rem;
  margin: 0.45rem 0;
  flex-shrink: 0;
}

.code-box p {
  margin: 0;
  font-size: clamp(0.78rem, 3vw, 0.9rem);
  font-weight: 600;
}

.btn-copy {
  width: auto;
  min-height: 42px;
  padding: 0.35rem 0.55rem;
  font-size: 0.72rem;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.1;
  border-radius: 0.55rem;
}

.btn-copy img { width: 16px; height: 16px; }

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
  width: 100%;
  margin: 0.25rem 0 0.45rem;
  flex-shrink: 0;
}

.tab {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: clamp(0.68rem, 2.8vw, 0.78rem);
  min-height: 40px;
  border: 1.5px solid rgba(12,30,74,.25);
  border-radius: 0.55rem;
  background: #fff;
  color: var(--marine);
  cursor: pointer;
  padding: 0.35rem 0.15rem;
}

.tab.is-active {
  background: var(--or);
  border-color: #d4a010;
  box-shadow: 0 2px 0 rgba(160,120,0,.25);
}

.classement-head {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  flex-shrink: 0;
}

.classement-head em {
  color: var(--rouge);
  font-style: italic;
  font-weight: 700;
}

.classement {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}

.classement li {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(12,30,74,.12);
  font-weight: 600;
  font-size: clamp(0.9rem, 3.4vw, 1rem);
}

.classement li:last-child { border-bottom: none; }

.rank {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  background: rgba(12,30,74,.08);
}

.medal-gold { background: linear-gradient(145deg, #f5d76e, #d4a017); color: #fff; }
.medal-silver { background: linear-gradient(145deg, #e0e0e0, #9a9a9a); color: #fff; }
.medal-bronze { background: linear-gradient(145deg, #e0a06a, #a05a28); color: #fff; }

.km { font-weight: 700; color: var(--marine); }

/* —— Décors bas —— */
.decor-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18dvh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}

.screen > :not(.decor-bottom) { position: relative; z-index: 1; }

.decor-montagnes {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 390 120' preserveAspectRatio='none'%3E%3Cpath fill='%237aabcc' d='M0 70 L60 30 L110 55 L160 20 L220 50 L280 25 L340 48 L390 35 V120 H0Z' opacity='.55'/%3E%3Cpath fill='%235a9aaa' d='M0 85 L80 50 L140 70 L200 45 L270 68 L330 40 L390 60 V120 H0Z' opacity='.45'/%3E%3Cpath fill='%232E6B3A' d='M10 120 L30 70 L50 120Z'/%3E%3Cpath fill='%231f4d2a' d='M40 120 L65 55 L90 120Z'/%3E%3Cpath fill='%23c4782a' d='M85 120 L105 75 L125 120Z'/%3E%3Cpath fill='%232E6B3A' d='M280 120 L305 60 L330 120Z'/%3E%3Cpath fill='%23d4a017' d='M320 120 L345 70 L370 120Z'/%3E%3Cpath fill='%231f4d2a' d='M350 120 L375 80 L390 120Z'/%3E%3Cellipse cx='200' cy='95' rx='90' ry='18' fill='%236ba8d4' opacity='.5'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
  opacity: 0.9;
}

.decor-drapeau {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 390 120' preserveAspectRatio='none'%3E%3Cpath fill='%238bb8d4' d='M0 60 L70 35 L140 55 L210 28 L290 50 L390 30 V120 H0Z' opacity='.5'/%3E%3Cpath fill='%232E6B3A' d='M20 120 L45 65 L70 120Z'/%3E%3Cpath fill='%231f4d2a' d='M55 120 L80 55 L105 120Z'/%3E%3Cpath fill='%23c4782a' d='M95 120 L115 72 L135 120Z'/%3E%3Crect x='320' y='48' width='42' height='28' fill='%231658C4' stroke='%230C1E4A'/%3E%3Cpath fill='%23fff' d='M341 54c.2 1-.1 1.7-.7 2.3.8-.2 1.5-.1 2.1.4-.3-.8-.1-1.6.6-2.3-.8.5-1.4 1.1-2 .0zM341 57.5c-1.4.5-2.2 1.5-2.4 2.7.9-.5 1.7-.7 2.6-.5-.6.7-.8 1.5-.5 2.5.4-.9 1.1-1.5 2-1.9-.1.9.2 1.7.9 2.3.2-1.3-.1-2.3-.8-3.1.9.1 1.6.5 2.2 1.1-.4-1.2-1.3-2.1-2.5-2.5.8-.1 1.4-.4 2-.9-1 .2-1.9.1-2.7-.4.4.7.3 1.4-.2 2z'/%3E%3Cline x1='320' y1='76' x2='320' y2='110' stroke='%238b7355' stroke-width='3'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
  opacity: 0.92;
}

.decor-sapins {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 390 120' preserveAspectRatio='none'%3E%3Cpath fill='%239bbfd4' d='M0 70 L100 45 L200 65 L300 40 L390 55 V120 H0Z' opacity='.4'/%3E%3Cpath fill='%231f4d2a' d='M15 120 L40 50 L65 120Z'/%3E%3Cpath fill='%232E6B3A' d='M50 120 L80 40 L110 120Z'/%3E%3Cpath fill='%23c4782a' d='M95 120 L120 58 L145 120Z'/%3E%3Cpath fill='%23d4891a' d='M130 120 L150 70 L170 120Z'/%3E%3Cpath fill='%232E6B3A' d='M250 120 L280 45 L310 120Z'/%3E%3Cpath fill='%231f4d2a' d='M295 120 L325 55 L355 120Z'/%3E%3Cpath fill='%23c4782a' d='M340 120 L365 65 L390 120Z'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
  opacity: 0.9;
}

/* —— Toast —— */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  background: var(--marine);
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 100;
  max-width: min(90vw, 400px);
  text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}

.toast[hidden] { display: none; }

/* —— Desktop ≥ 1024px —— */
@media (min-width: 1024px) {
  body {
    display: flex;
    align-items: stretch;
    justify-content: center;
  }

  .desktop-decor {
    display: block;
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
  }

  .decor-left,
  .decor-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: calc((100% - var(--col-max)) / 2);
    opacity: 0.9;
  }

  .decor-left {
    left: 0;
    background:
      radial-gradient(ellipse at 70% 30%, rgba(22,88,196,.25), transparent 50%),
      radial-gradient(ellipse at 40% 70%, rgba(46,107,58,.35), transparent 45%),
      radial-gradient(ellipse at 60% 85%, rgba(196,120,42,.3), transparent 40%),
      linear-gradient(160deg, #c5dce8 0%, #e8d9b0 40%, #b8cfa0 100%);
  }

  .decor-left::before {
    content: "";
    position: absolute;
    left: 12%;
    top: 18%;
    width: 55%;
    height: 35%;
    background:
      linear-gradient(180deg, #5a7a9a 0 18%, #c9b896 18% 100%);
    clip-path: polygon(20% 40%, 35% 10%, 42% 28%, 50% 0, 58% 28%, 65% 8%, 80% 40%, 75% 100%, 25% 100%);
    opacity: 0.55;
  }

  .decor-right {
    right: 0;
    background:
      radial-gradient(ellipse at 30% 40%, rgba(46,107,58,.4), transparent 50%),
      radial-gradient(ellipse at 60% 75%, rgba(180,60,40,.2), transparent 45%),
      linear-gradient(200deg, #d4e4f0, #e8c9a0 50%, #8fbf8a);
  }

  .decor-right::after {
    content: "";
    position: absolute;
    right: 18%;
    bottom: 22%;
    width: 48px;
    height: 32px;
    background: #1658C4;
    border: 2px solid #0C1E4A;
    opacity: 0.7;
  }

  .app {
    position: relative;
    z-index: 1;
    width: var(--col-max);
    max-width: var(--col-max);
    height: 100dvh;
    box-shadow: 0 0 40px rgba(12,30,74,.12);
    background: var(--parchemin);
    background-image:
      radial-gradient(ellipse at 20% 10%, rgba(255,255,255,.35), transparent 50%),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.85 0 0 0 0 0.78 0 0 0 0 0.62 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
  }

  .carte-trajet { max-height: 20dvh; }
  .carte-compact { max-height: 16dvh; }
  .joe-img { max-height: 24dvh; }
}

@media (max-height: 700px) {
  .joe-img { max-height: 16dvh; }
  .carte-trajet { max-height: 14dvh; }
  .animaux-row img { width: 64px; }
  .decor-bottom { height: 12dvh; opacity: .7; }
}
