/* Outils de la communauté et tableau de bord admin */
html body.aventure.aventure .ot { position: relative; z-index: 1; display: grid; gap: 18px; box-sizing: border-box; width: min(1240px, calc(100% - 32px)); margin: 100px auto 60px; flex: 1; color: var(--texte-papier); text-align: left; }
.ot-pile { display: grid; gap: 18px; }
.ot-pile[hidden] { display: none; }
.ot-carte { padding: clamp(16px, 2.4vw, 24px); border: 1px solid var(--cadre-bord); border-radius: 20px; background: var(--papier); box-shadow: var(--cadre-ombre); scroll-margin-top: 100px; }
html body.aventure .ot h1 { margin: 0 0 4px; color: var(--encre-texte); font-size: clamp(1.6rem, 2.6vw, 2.1rem); line-height: 1.1; }
html body.aventure .ot h2 { margin: 0 0 12px; color: var(--encre-texte); font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.1; }
html body.aventure .ot h3 { margin: 18px 0 8px; color: var(--encre-texte); font: 400 1.05rem/1.2 var(--bd); }
.ot-chapo { margin: 0; font-size: .98rem; line-height: 1.5; }
.ot-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 24px 0 0; }
.ot .block { min-height: 40px; padding-block: 5px; font-size: .92rem; text-decoration: none; }
.ot-discord { display: inline-flex; align-items: center; gap: 10px; }
.ot-vide { margin: 0; padding: 26px; border: 2px dashed rgb(29 36 66 / .4); border-radius: 12px; text-align: center; }

html body.aventure .ot .ot-grille { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
html body.aventure .ot .ot-grille[hidden] { display: none; }
html body.aventure .ot .ot-grille > li { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 20px; border: 1px solid var(--cadre-bord); border-radius: 20px; background: var(--champ); box-shadow: var(--cadre-ombre-douce); min-width: 0; }
.ot-grille h3 { overflow-wrap: anywhere; }
html body.aventure .ot .ot-grille h3 { margin: 0; }
.ot-grille p { flex: 1; margin: 0; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.45; }
.ot-auteur { font-size: .8rem; }
.ot-liens { display: flex; flex-wrap: wrap; gap: 8px 14px; font-weight: 600; }
html body.aventure .ot-liens a { color: var(--rouge-texte); }

.ot-interdit { margin-bottom: 14px; padding: 14px 18px; border: 3px solid #b23a14; border-radius: 12px; background: #ffe3d6; color: #6f220b; }
.ot-interdit strong { display: block; margin-bottom: 2px; font: 400 1.2rem/1.25 var(--bd); }
.ot-interdit p { margin: 0; font-weight: 600; line-height: 1.45; }
.ot-conseil { margin: 0 0 20px; line-height: 1.5; }
.ot-message { margin: 0 0 14px; padding: 9px 13px; border-radius: 10px; font-weight: 600; }
.ot-erreur { border: 2px solid #b23a14; color: #8f2d0f; background: #ffe3d6; }
.ot-ok { border: 2px solid #23774c; color: #165a37; background: #dcf5e6; }
.ot-compte { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; margin-bottom: 18px; padding: 10px 14px; border-radius: 10px; background: var(--papier-2); }
.ot-compte strong { color: var(--encre-texte); overflow-wrap: anywhere; }
.ot-lien { padding: 2px 0; border: 0; background: none; color: var(--encre-texte); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

.ot-form { display: grid; gap: 10px; max-width: 760px; }
.ot-form label, .ad-motif { display: grid; gap: 6px; color: var(--encre-texte); font-weight: 600; }
.ot-option { font-weight: 400; }
html body.aventure .ot-form input:not([type="checkbox"]), html body.aventure .ot-form textarea, html body.aventure .ad-motif textarea { box-sizing: border-box; width: 100%; min-height: 38px; padding: 6px 10px; border: 1px solid var(--cadre-bord); border-radius: 11px; background: var(--champ); color: var(--encre-texte); font: inherit; font-weight: 400; resize: vertical; }
html body.aventure .ot-form .ot-case { display: flex; align-items: flex-start; gap: 10px; }
.ot-case input { flex: none; width: 20px; height: 20px; margin-top: 3px; accent-color: #e4572e; }
.ot-form button { justify-self: start; }
.ot-form button:disabled { opacity: .6; cursor: wait; }

html body.aventure .ot .ot-miens, html body.aventure .ot .ad-demandes { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
html body.aventure .ot .ot-miens li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0; padding: 12px 14px; border: 1px solid var(--cadre-bord); border-radius: 14px; background: var(--champ); }
.ot-miens strong { color: var(--encre-texte); overflow-wrap: anywhere; }
.ot-statut { margin-left: auto; padding: 1px 8px; border-radius: 6px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.ot-statut[data-statut="attente"] { color: #33230a; background: #ffd04a; }
.ot-statut[data-statut="accepte"] { color: #fff; background: #23774c; }
.ot-statut[data-statut="refuse"] { color: #fff; background: #b23a14; }
.ot-motif { flex: 1 1 100%; margin: 0; font-size: .95rem; overflow-wrap: anywhere; }

html body.aventure .ot .ad-chiffres { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
html body.aventure .ot .ad-chiffres li { display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 10px 14px; border: 1px solid var(--cadre-bord); border-radius: 14px; font-size: .9rem; background: var(--papier); box-shadow: var(--cadre-ombre-douce); }
.ad-chiffres strong { color: var(--encre-texte); font: 400 1.5rem/1.1 var(--bd); }
.ad-filtres { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ad-filtres button { min-height: 32px; padding: 3px 11px; border: 2px solid var(--encre); border-radius: 8px; background: var(--champ); color: var(--encre-texte); font: 400 .88rem/1.2 var(--bd); cursor: pointer; }
.ad-filtres button[aria-pressed="true"] { background: linear-gradient(180deg, #4cc6f7, #1a90f2); }
html body.aventure .ot .ad-demandes > li { display: grid; gap: 6px; margin: 0; padding: 11px 14px; border: 1px solid var(--cadre-bord); border-radius: 14px; font-size: .92rem; background: var(--champ); }
.ad-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
html body.aventure .ot .ad-tete h3 { margin: 0; overflow-wrap: anywhere; }
.ad-meta { margin: 0; font-size: .82rem; overflow-wrap: anywhere; }
.ad-meta code { font-size: .9em; }
.ad-desc { margin: 0; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.45; }
.ad-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ad-actions button { min-height: 32px; padding: 3px 11px; border: 2px solid var(--encre); border-radius: 8px; background: var(--champ-survol); color: var(--encre-texte); font: 400 .86rem/1.2 var(--bd); cursor: pointer; }
.ad-actions .ad-ok { color: #fff; background: #23774c; }
.ad-actions .ad-non { color: #fff; background: #b23a14; }
html body.aventure .ot .ad-raccourcis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
html body.aventure .ot .ad-raccourcis li { margin: 0; }
html body.aventure .ot .ad-raccourcis a { display: block; padding: 7px 11px; border: 2px solid var(--encre); border-radius: 8px; background: var(--champ); color: var(--encre-texte); font: 400 .9rem/1.25 var(--bd); text-decoration: none; }
.ad-raccourcis a:hover { background: var(--papier-2); }
.ad-motif { margin-top: 14px; }

@media (max-width: 960px) {
  html body.aventure.aventure .ot { margin-top: 92px; }
  html body.aventure .ot .ot-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html body.aventure .ot .ad-chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  html body.aventure .ot .ot-grille { grid-template-columns: minmax(0, 1fr); }
  .ot-actions .block, .ot-form button { flex: 1 1 100%; justify-self: stretch; text-align: center; }
}

/* Page des outils : galerie à gauche, proposition à droite */
html body.aventure.aventure .ot-page { grid-template-columns: minmax(0, 1fr) 350px; align-items: start; }
.ot-principal { display: grid; gap: 18px; min-width: 0; }
.ot-masque { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.ot-banniere { padding: clamp(18px, 2.6vw, 26px); border: 1px solid var(--cadre-bord); border-radius: 20px; color: #e8f4ff; background: linear-gradient(135deg, #1d2138 0%, #3a2a70 62%, #8c3f86 100%); box-shadow: var(--cadre-ombre); }
.ot-sur { margin: 0 0 4px; color: #ffd04a; font: 400 .82rem/1.2 var(--bd); letter-spacing: .05em; text-transform: uppercase; }
html body.aventure .ot-banniere h1 { color: #fff; font-size: clamp(1.8rem, 3.2vw, 2.5rem); }
.ot-banniere .ot-chapo { max-width: 620px; color: #e8f4ff; }
html body.aventure .ot-banniere a { color: #ffd04a; }

html body.aventure .ot .ot-galerie { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
html body.aventure .ot .ot-galerie[hidden] { display: none; }
html body.aventure .ot .ot-outil { --teinte: #ffb300; display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--cadre-bord); border-radius: 14px; font-size: .92rem; background: var(--papier); box-shadow: var(--cadre-ombre-douce); transition: transform .14s; }
.ot-outil:hover { transform: translateY(-3px) rotate(-.4deg); }
html body.aventure .ot .ot-outil:nth-child(4n + 2) { --teinte: #5865f2; }
html body.aventure .ot .ot-outil:nth-child(4n + 3) { --teinte: #3fa66c; }
html body.aventure .ot .ot-outil:nth-child(4n + 4) { --teinte: #e4572e; }
html body.aventure .ot .ot-outil:first-child { grid-column: 1 / -1; border-color: rgb(255 179 0 / .55); background: linear-gradient(135deg, rgb(255 179 0 / .22), var(--papier) 60%); }
.ot-outil-tete { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ot-outil-tete > div { min-width: 0; }
.ot-lettre { display: grid; flex: none; place-items: center; width: 40px; height: 40px; border: 1px solid var(--cadre-bord); border-radius: 14px; color: #fff; background: var(--teinte); font: 400 1.25rem/1 var(--bd); text-shadow: 0 2px 0 rgb(29 36 66 / .55); }
.ot-outil:first-child .ot-lettre { width: 48px; height: 48px; font-size: 1.5rem; }
html body.aventure .ot .ot-outil h3 { margin: 0; overflow-wrap: anywhere; }
html body.aventure .ot .ot-outil h3 { font-size: 1.05rem; }
html body.aventure .ot .ot-outil:first-child h3 { font-size: 1.25rem; }
.ot-outil p { flex: 1; margin: 0; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.5; }
.ot-vide-grand { display: grid; justify-items: center; gap: 6px; padding: 30px 20px; border: 2px dashed var(--encre); border-radius: 12px; background: var(--papier); text-align: center; }
.ot-vide-grand[hidden] { display: none; }
.ot-vide-grand span { font-size: 2rem; line-height: 1; }
.ot-vide-grand p { max-width: 420px; margin: 0; font-size: .96rem; }

html body.aventure .ot .ot-proposer { padding: 16px; font-size: .9rem; }
.ot-proposer:has(#ot-invite:not([hidden])) { position: sticky; top: 92px; }
html body.aventure .ot .ot-proposer h2 { margin-bottom: 10px; font-size: 1.25rem; }
.ot-proposer .ot-interdit { padding: 8px 10px; border-width: 2px; }
.ot-proposer .ot-interdit strong { font-size: .92rem; }
.ot-proposer .ot-interdit p { font-size: .82rem; }
.ot-proposer .ot-conseil { margin-bottom: 12px; font-size: .82rem; }
.ot-proposer .ot-form button { justify-self: stretch; }
.ot-proposer .ot-discord { display: flex; justify-content: center; margin-top: 12px; }
.ot-proposer #ot-invite p { margin: 0; }
html body.aventure .ot .ot-proposer .ot-miens li { padding: 8px 10px; }

@media (max-width: 1040px) {
  html body.aventure.aventure .ot-page { grid-template-columns: minmax(0, 1fr); }
  .ot-proposer:has(#ot-invite:not([hidden])) { position: static; }
}
@media (max-width: 620px) {
  html body.aventure .ot .ot-galerie { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .ot-outil { transition: none; }
  .ot-outil:hover { transform: none; }
}

/* Suivi des demandes */
html body.aventure .ot .ot-miens li { display: grid; gap: 12px; }
.ot-suivi-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ot-numero { font-size: .8rem; font-weight: 700; }
html body.aventure .ot .ot-etapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
html body.aventure .ot .ot-etapes li { display: block; min-width: 0; margin: 0; padding: 8px 0 0; border: 0; border-top: 4px solid rgb(29 36 66 / .18); border-radius: 0; background: none; font-size: .74rem; line-height: 1.25; }
html body.aventure .ot .ot-etapes li[data-etat="faite"] { border-top-color: #23774c; }
html body.aventure .ot .ot-etapes li[data-etat="actuelle"] { border-top-color: #ffb300; }
html body.aventure .ot .ot-etapes li[data-etat="refus"] { border-top-color: #b23a14; }
html body.aventure .ot .ot-etapes li[data-etat="avenir"] { opacity: .65; }
.ot-etapes strong { display: block; font-weight: 700; }
.ot-etapes span { display: block; }
html body.aventure .ot .ot-proposer .ot-etapes li { padding: 8px 0 0; }

/* Tableau de bord : en-tête compact, titre à gauche et déconnexion à droite */
.ot-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 16px; padding-block: 14px; }
.ot-hero h1, .ot-hero .ot-chapo { grid-column: 1; }
.ot-hero .ot-message { grid-column: 1 / -1; margin: 8px 0 0; }
.ot-hero > p#ad-invite, .ot-hero > p#ad-sortie { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
@media (max-width: 560px) {
  .ot-hero { grid-template-columns: minmax(0, 1fr); }
  .ot-hero > p#ad-invite, .ot-hero > p#ad-sortie { grid-column: 1; grid-row: auto; margin-top: 8px; }
}

/* Compte non lié et gestion depuis le profil */
.ot-non-lie { border: 2px solid #c98400; color: #5e3f00; background: #fff0c4; font-weight: 400; }
.ot-non-lie strong { display: block; }
.ot-non-lie p { margin: 2px 0 0; }
.ot-gerer { margin: 0 0 8px; font-size: .82rem; }
.mo-ajouter { min-height: 36px; padding-block: 4px; font-size: .86rem; text-decoration: none; }
html body.aventure .mo-liste { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
html body.aventure .mo-liste > li { display: grid; gap: 6px; margin: 0; padding: 11px 14px; border: 1px solid var(--cadre-bord); border-radius: 14px; background: var(--champ); font-size: .92rem; }
.mo-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.mo-tete strong { color: var(--encre-texte); font: 400 1.05rem/1.2 var(--bd); overflow-wrap: anywhere; }
.mo-desc { margin: 0; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.4; }
.mo-ouvrir { display: inline-flex; align-items: center; min-height: 32px; padding: 3px 11px; border: 2px solid var(--encre); border-radius: 8px; background: var(--champ-survol); color: var(--encre-texte) !important; font: 400 .86rem/1.2 var(--bd); text-decoration: none; }
.mo-form { margin-top: 12px; }
html body.aventure .fenetre .mo-form input:not([type="checkbox"]), html body.aventure .fenetre .mo-form textarea { box-sizing: border-box; width: 100%; min-height: 38px; padding: 6px 10px; border: 1px solid var(--cadre-bord); border-radius: 11px; background: var(--champ); color: var(--encre-texte); font: inherit; font-weight: 400; resize: vertical; }
html body.aventure .fenetre .mo-form .fenetre-actions { margin-top: 6px; }
html body.aventure .fenetre .mo-form .ot-case { display: flex; align-items: flex-start; gap: 10px; }

/* Page des outils : bouton dans la bannière, formulaire en fenêtre */
.ot-banniere { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
.ot-banniere > div { flex: 1 1 320px; min-width: 0; }
.ot-ouvrir { flex: none; }
html body.aventure .ot .ot-cote { padding: 16px; font-size: .9rem; }
html body.aventure .ot .ot-cote h2 { margin-bottom: 12px; font-size: 1.25rem; }
html body.aventure .ot .ot-marche { display: grid; gap: 10px; margin: 0 0 12px; padding: 0; list-style: none; counter-reset: marche; }
html body.aventure .ot .ot-marche li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 10px; margin: 0; padding: 0; line-height: 1.35; counter-increment: marche; }
.ot-marche li::before { content: counter(marche); grid-row: span 2; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: #fff; background: var(--encre); font: 400 .92rem/1 var(--bd); }
.ot-marche strong { color: var(--encre-texte); font: 400 .98rem/1.25 var(--bd); }
.ot-regle-courte { margin: 0; padding: 8px 10px; border-radius: 9px; color: #6f220b; background: #ffe3d6; font-size: .84rem; font-weight: 600; }
.ot-regle-courte strong { color: inherit; }
#ot-espace { margin-top: 14px; }
html body.aventure .ot .ot-cote h3 { margin-top: 14px; }
html body.aventure .ot .ot-cote .ot-miens li { padding: 8px 10px; }
html body.aventure .ot .ot-cote .ot-etapes li { padding: 8px 0 0; }

html body.aventure .ot-fenetre { box-sizing: border-box; width: min(580px, calc(100% - 24px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 20px 22px; font-size: .94rem; }
.ot-fenetre-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
html body.aventure .ot-fenetre h2 { margin: 0; font-size: 1.4rem; }
.ot-fermer { flex: none; width: 34px; height: 34px; border: 2px solid var(--encre); border-radius: 9px; background: var(--champ); color: var(--encre-texte); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.ot-fermer:hover { background: var(--papier-2); }
.ot-fenetre .ot-interdit { margin-bottom: 12px; padding: 8px 12px; border-width: 2px; }
.ot-fenetre .ot-interdit strong { font-size: .94rem; }
html body.aventure .ot-fenetre .ot-interdit p { font-size: .84rem; line-height: 1.35; }
html body.aventure .ot-fenetre #ot-invite p { margin: 0 0 12px; }
.ot-fenetre .ot-discord { display: flex; justify-content: center; min-height: 44px; text-decoration: none; }
html body.aventure .ot-fenetre .ot-non-lie { margin: 0; }
.ot-fenetre .ot-form { max-width: none; gap: 11px; }
html body.aventure .ot-fenetre .ot-form label { display: grid; gap: 4px; color: var(--encre-texte); font-weight: 600; }
html body.aventure .ot-fenetre .ot-form label.ot-case { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; line-height: 1.35; }
html body.aventure .ot-fenetre .ot-form input:not([type="checkbox"]), html body.aventure .ot-fenetre .ot-form textarea { box-sizing: border-box; width: 100%; min-height: 40px; padding: 7px 10px; border: 1px solid var(--cadre-bord); border-radius: 11px; background: var(--champ); color: var(--encre-texte); font: inherit; font-weight: 400; resize: vertical; }
html body.aventure .ot-fenetre .ot-form input::placeholder, html body.aventure .ot-fenetre .ot-form textarea::placeholder { color: var(--indice); }
html body.aventure .ot-fenetre .ot-form small { color: var(--doux-papier, #5e4a26); font-size: .8rem; font-weight: 400; }
.ot-etiquette { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ot-requis { color: var(--rouge-texte); font-weight: 800; }
.ot-facultatif { margin-left: 4px; padding: 1px 7px; border-radius: 6px; background: var(--papier-2); font-size: .74rem; font-weight: 600; }
.ot-compteur { color: #6b5a40; font-size: .76rem; font-weight: 400; white-space: nowrap; }
html body.aventure .ot-fenetre .ot-legende { margin: 0; font-size: .82rem; }
html body.aventure .ot-fenetre .ot-conseil { margin: 0; padding: 7px 10px; border-radius: 9px; background: #e3f1fb; font-size: .82rem; line-height: 1.35; }
html body.aventure .ot-fenetre .fenetre-actions { margin-top: 4px; }
html body.aventure .ot-fenetre .fenetre-erreur { margin: 0; padding: 8px 12px; border: 2px solid #b23a14; border-radius: 10px; color: #8f2d0f; background: #ffe3d6; font-weight: 600; }
.ot-fenetre .ot-form button:disabled { opacity: .6; cursor: wait; }
@media (max-width: 420px) { .ot-ouvrir { width: 100%; } }
html body.aventure .ot-cote .ot-gerer a { color: var(--rouge-texte); }

/* Lisibilité : les encarts pastel gardent leur texte foncé quel que soit le thème (les titres héritaient du blanc du thème sombre) */
html body.aventure :is(.ot-interdit, .ot-erreur, .ot-ok, .ot-non-lie, .ot-regle-courte) :is(strong, p, a, code) { color: inherit; }
html body.aventure .ot-fenetre .ot-conseil { color: #1d2442; }
html body.aventure .ot-fenetre .ot-conseil :is(a, code, strong) { color: #0b4fa8; }
html body.aventure .ot-fenetre .ot-conseil code { background: rgb(11 79 168 / .12); }
