/* Styles du module community et des écrans socle (accueil, connexion, profil, tableau de bord) — compléments de app.css. */

:root {
    /* Orange assombri pour le texte sur fond clair : #ff7a00 n'atteint pas le contraste AA en petite taille. */
    /* --primary-text est défini dans app.css */
}

/* --- Utilitaires de mise en page --- */
.section { margin-top: 24px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; }
.section-head a { font-weight: 700; font-size: .9rem; color: var(--primary-text); }
.row-center { justify-content: center; }
.row-tight { gap: 6px; }
.text-right { text-align: right; }
.strong-link { font-weight: 800; color: var(--primary-text); }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.form-actions .btn { flex: 1 1 140px; }
.xp-value { color: var(--primary-text); font-weight: 800; }
.list-wrap { flex-wrap: wrap; }
.avatar-field { flex-wrap: wrap; }
.account-email { overflow-wrap: anywhere; }

/* Listes à vignettes (compléments de .media-list / .media-item) */
ul.media-list { list-style: none; margin: 0; padding: 0; }
.media-list > li { display: flex; min-width: 0; }
.media-list > li > .media-item { flex: 1; min-width: 0; }
@media (min-width: 900px) { .media-list.media-list-1 { grid-template-columns: minmax(0, 1fr); } }
.media-item-sm { padding: 10px 12px; align-items: center; }
.media-item-sm .media-thumb { flex-basis: 64px; width: 64px; height: 64px; }
.media-body .tag { align-self: flex-start; }
a.media-title { color: var(--text); }
a.media-title:hover { color: var(--primary-text); }
.media-aside-row { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.media-aside-center { justify-content: center; }
.reward-price { background: var(--primary); color: #15151a; font-weight: 800; }

/* Pastille de date (événements) */
.date-chip { flex: 0 0 64px; height: 64px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-text); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; line-height: 1.1; }
.date-chip strong { font-size: 1.4rem; font-weight: 900; }
.event-thumb { position: relative; }
.date-chip-overlay { position: absolute; left: 6px; bottom: 6px; height: auto; padding: 3px 6px; background: rgba(255, 255, 255, .95); font-size: .62rem; }
.date-chip-overlay strong { font-size: 1rem; }
.is-cancelled .media-thumb, .is-cancelled .date-chip { opacity: .5; filter: grayscale(1); }
.event-title { margin-top: 8px; }
.event-actions { margin-top: 12px; }

/* --- Accueil visiteur --- */
.home-hero { display: grid; gap: 20px; }
@media (min-width: 900px) { .home-hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: center; gap: 40px; } }
.home-banner { padding: 28px 20px 0; }
.hero-logo { margin: 0; color: #fff; font-size: clamp(3rem, 17vw, 5.2rem); font-weight: 900; font-style: italic; text-transform: uppercase; line-height: .88; letter-spacing: -.03em; transform: rotate(-6deg); transform-origin: left bottom; }
.hero-logo span { display: block; }
.hero-logo-accent { color: var(--primary); }
.hero-tagline { margin: 14px 0 10px; color: #fff; font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: .02em; transform: rotate(-6deg); transform-origin: left; }
.hero-banner .hero-tagline { color: #fff; }
.hero-art { width: calc(100% + 40px); max-width: none; margin: 8px -20px 0; aspect-ratio: 4 / 3; object-fit: cover; }
.home-banner .hero-words { position: absolute; left: 14px; bottom: 18px; margin: 0; padding: 8px 14px; background: #15151a; border-radius: 8px; font-size: clamp(1.15rem, 5.5vw, 1.7rem); box-shadow: 0 6px 16px rgba(0, 0, 0, .3); }
.hero-actions { display: grid; gap: 12px; }
.hero-intro { margin: 0 0 4px; color: var(--text-muted); }
@media (min-width: 900px) { .hero-intro { font-size: 1.15rem; } }
.home-counters { margin-top: 24px; }
.steps-list.card { padding: 18px; }

/* --- Connexion / inscription --- */
.auth-page { padding-top: 8px; }
.auth-brand { display: block; width: max-content; margin: 8px auto 4px; color: var(--text); font-size: clamp(2.2rem, 11vw, 3rem); font-weight: 900; font-style: italic; text-transform: uppercase; line-height: .95; letter-spacing: -.02em; transform: rotate(-5deg); }
.auth-brand:hover { color: var(--text); text-decoration: none; }
.auth-tagline { margin: 6px 0 20px; text-align: center; color: var(--text-muted); font-size: .85rem; font-weight: 800; font-style: italic; text-transform: uppercase; transform: rotate(-5deg); }
.auth-page h1 { text-align: center; font-size: 1.5rem; }
.auth-page > .muted { text-align: center; }
.auth-alt { display: grid; gap: 8px; margin-top: 16px; text-align: center; }

/* --- Profil --- */
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding-bottom: 4px; }
.profile-head-bar { align-self: stretch; display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.profile-head-title { margin: 0; font-size: 1.5rem; font-weight: 900; }
.profile-head-bar .icon-btn { width: 44px; height: 44px; margin-left: auto; }
.profile-avatar { border: 4px solid var(--surface); box-shadow: var(--shadow); }
.profile-name { margin: 6px 0 0; font-size: 1.5rem; overflow-wrap: anywhere; }
.profile-level { margin: 0; color: var(--primary-text); font-weight: 700; }
.profile-xp { width: 100%; max-width: 320px; display: grid; gap: 4px; text-align: right; }
.profile-meta { justify-content: center; }
.profile-bio { max-width: 36rem; margin: 4px 0 0; }
.profile-head + .counters { margin-top: 16px; }
.profile-badges { list-style: none; margin: 0; padding: 0; }
.profile-badges li { width: 58px; display: grid; justify-items: center; gap: 4px; }
.hex-name { font-size: .7rem; line-height: 1.2; color: var(--text-muted); text-align: center; overflow-wrap: anywhere; }
.promo-card .promo-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.promo-arrow { font-size: 1.8rem; font-weight: 900; line-height: 1; color: var(--primary-text); }
.link-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .link-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.link-tiles a { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: .9rem; font-weight: 700; }
.link-tiles a:hover { border-color: var(--primary); color: var(--primary-text); text-decoration: none; }
.link-tiles .ico { font-size: 1.2rem; }
.counters.counters-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.counters .xp-value { color: var(--primary-text); }

/* --- Tableau de bord --- */
.dash-hello { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.xp-card { display: grid; gap: 12px; }
.xp-card-head { display: flex; align-items: center; gap: 14px; }
.xp-card-hex { flex: 0 0 auto; width: 52px; height: 58px; font-size: 1.4rem; }
.xp-card-level { min-width: 0; }
.xp-card-level h2 { font-size: 1.15rem; color: var(--primary-text); }
.xp-card .counters { box-shadow: none; }
.xp-card-counters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.6fr); }
.counters .counter-text { font-size: 1rem; overflow-wrap: anywhere; }
.current-quest { border: 2px solid var(--primary); display: grid; gap: 8px; }
.current-quest > * { margin-top: 0; margin-bottom: 0; }
.current-quest-label { justify-self: start; padding: 3px 10px; border-radius: 6px; background: var(--primary-soft); color: var(--primary-text); font-size: .72rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.current-quest-title { font-size: 1.3rem; }

/* --- Équipes --- */
.search-form { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.search-form .search-field { flex: 1; min-width: 0; }
/* app.css : la règle générique des champs (déclarée après) écrase le retrait de la loupe. */
.search-form .search-field input { padding-left: 42px; }
.team-logo { flex: 0 0 auto; width: 84px; height: 84px; border-radius: var(--radius-sm); object-fit: cover; background: var(--primary-soft); }
.team-logo-sm { width: 56px; height: 56px; }
.team-logo-lg { width: 104px; height: 104px; border-radius: var(--radius); }
.team-hero { display: grid; gap: 14px; }
.team-hero-head { display: flex; align-items: center; gap: 14px; color: inherit; }
.team-hero-head:hover { color: inherit; text-decoration: none; }
.team-hero-head:hover .team-hero-name { color: var(--primary-text); }
.team-hero-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.team-hero-name { font-size: 1.2rem; font-weight: 900; overflow-wrap: anywhere; }
.team-hero-arrow { font-size: 1.8rem; color: var(--text-muted); }
.card .team-figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.team-figures > div { padding: 10px 6px; border-radius: var(--radius-sm); background: var(--surface-2); text-align: center; }
.card .team-figures dt { margin: 0; color: var(--text-muted); font-size: .72rem; font-weight: 600; }
.card .team-figures dd { margin: 0; font-size: 1.15rem; font-weight: 900; }
.team-figures .xp-value { color: var(--primary-text); }
.avatar-stack { align-items: center; }
.avatar-more { display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text-muted); font-size: .75rem; font-weight: 800; }
.team-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.team-head { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.team-head-name { margin: 0; overflow-wrap: anywhere; }
.team-head-meta { justify-content: center; }
.team-head-actions { margin-top: 4px; }
.member-row { flex-wrap: nowrap; min-width: 0; }
.member-row a { overflow-wrap: anywhere; }

/* Ancienne carte d'équipe (administration) */
.team-card-title { font-size: 1.05rem; }

/* Fiches de détail (signalements, administration) */
.card dl { margin: 12px 0; }
.card dt { font-weight: 600; color: var(--text-muted); font-size: .85rem; margin-top: 10px; }
.card dd { margin: 4px 0 0; }

/* --- Notifications --- */
.notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.notif-item { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.notif-item.notif-unread { border-left: 4px solid var(--primary); padding-left: 14px; box-shadow: var(--shadow); }
.notif-ico { flex: 0 0 40px; height: 40px; border-radius: 50%; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; }
.notif-body { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.notif-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
/* Liste compacte (tableau de bord) : le contenu prend la place disponible */
.list > li > div { flex: 1 1 auto; min-width: 0; }

/* --- Parrainage --- */
.share-actions .btn { flex: 1 1 auto; }

/* --- Organisateurs, lots, billets, quêtes premium (ADR-018) --- */
.badge-premium { background: var(--yellow); color: #15151a; }
.prize-box { align-items: flex-start; }
.prize-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.prize-ico { flex: 0 0 56px; width: 56px; height: 56px; border-radius: var(--radius-sm); background: var(--primary-soft); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.ticket-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ticket-form label { font-weight: 700; }
.ticket-form select { flex: 1 1 140px; min-width: 0; }
.premium-lock { display: grid; gap: 10px; }
.organizer-nav { margin-bottom: 16px; }
.organizer-quota { margin-bottom: 16px; }
.organizer-actions { flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.organizer-events .media-item { padding: 12px 14px; }
.review-card h3 { margin: 12px 0 6px; }
.review-actions { flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.review-reject { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 260px; min-width: 0; }
.review-reject input { flex: 1 1 160px; min-width: 0; }
.list li > span.stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.list li > span.stack > * + * { margin-top: 0; }

/* --- CITY QUEST+ : prestige et communauté (ADR-038) — purement visuel --- */
.plus-name { color: #8a5f00; font-weight: 800; }
a.plus-name:hover { color: #6b4900; }
.plus-star { font-size: .85em; }
.badge.plus-lock { background: #fff3c4; color: #6b4900; border: 1px solid #e0b84a; font-weight: 800; }

/* Cadres d'avatar (classes appliquées seulement aux abonnés actifs) */
.avatar-frame { border-radius: 50%; }
.avatar-frame-or { box-shadow: 0 0 0 3px #f5c542, 0 0 0 5px #a87400; }
.avatar-frame-neon { box-shadow: 0 0 0 3px #2ef2ff, 0 0 10px 3px rgba(46, 242, 255, .7); }
.avatar-frame-lagune { box-shadow: 0 0 0 3px #3b97c9, 0 0 0 6px #7cc4e8; }
.avatar-frame-savane { box-shadow: 0 0 0 3px #c97a12, 0 0 0 6px #6a8f2a; }
.podium-place .avatar.avatar-frame { border-color: transparent; }

/* Galerie d'avatars et de cadres (Modifier mon profil) */
.plus-gallery legend { font-weight: 700; }
.plus-gallery.is-locked .plus-choices { opacity: .55; }
.plus-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; margin-top: 8px; }
.plus-choice { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: 2px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; text-align: center; }
.plus-choice input { margin: 0; }
.plus-choice:has(input:checked) { border-color: #e0b84a; background: #fffaf0; }
.plus-choice:has(input:focus-visible) { outline: 3px solid var(--text); outline-offset: 2px; }
.plus-choice .avatar { width: 56px; height: 56px; }
.frame-sample { display: block; width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); margin: 6px 0; }

/* Aperçu flouté des pages réservées */
.plus-teaser { position: relative; min-height: 360px; }
.plus-teaser-preview { filter: blur(6px); pointer-events: none; user-select: none; }
.plus-teaser-cta { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92%, 380px); text-align: center; border-color: #e0b84a; }
.plus-teaser-title { font-weight: 900; font-size: 1.1rem; color: #6b4900; margin: 0 0 6px; }

/* Carnet d'exploration */
.counters.counters-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.journal-map { height: 320px; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; background: var(--surface-2); }
.journal-map-sample { background: linear-gradient(135deg, #cfe8f5 0%, #e9f3e1 55%, #fff1d6 100%); }
.journal-city h2 { font-size: 1.05rem; }
.map-pin.journal-pin { background: #f5c542; }
.map-pin.journal-pin span { color: #15151a; }

/* Statistiques : barres XP par semaine (hauteur par classe bar-h-0…20, 6 px par pas) */
.xp-bars { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; align-items: end; min-height: 160px; }
.xp-bar-item { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; min-width: 0; }
.xp-bar { display: block; width: 100%; max-width: 28px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #f5c542, var(--primary)); }
.xp-bar-value, .xp-bar-label { white-space: nowrap; font-size: .62rem; }
.bar-h-0 { height: 2px; opacity: .4; } .bar-h-1 { height: 6px; } .bar-h-2 { height: 12px; } .bar-h-3 { height: 18px; }
.bar-h-4 { height: 24px; } .bar-h-5 { height: 30px; } .bar-h-6 { height: 36px; } .bar-h-7 { height: 42px; }
.bar-h-8 { height: 48px; } .bar-h-9 { height: 54px; } .bar-h-10 { height: 60px; } .bar-h-11 { height: 66px; }
.bar-h-12 { height: 72px; } .bar-h-13 { height: 78px; } .bar-h-14 { height: 84px; } .bar-h-15 { height: 90px; }
.bar-h-16 { height: 96px; } .bar-h-17 { height: 102px; } .bar-h-18 { height: 108px; } .bar-h-19 { height: 114px; }
.bar-h-20 { height: 120px; }
.type-breakdown li { flex-wrap: wrap; }
.type-breakdown progress { flex: 1 1 100%; }
