/* Mise en page commune ; couleurs, polices et formes viennent de /theme.css (univers × mode) */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 15px; line-height: 1.45; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.discret { color: var(--muted); }
.petit { font-size: 13px; }
.droite { margin-left: auto; }
.ellipse { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ellipse2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
:focus-visible { outline: 3px solid var(--accent2); outline-offset: 2px; }

/* titres */
.titre-xl { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 5vw, 58px); line-height: 1.02; margin: 6px 0 8px; }
.titre-l { font-family: var(--display); font-weight: 400; font-size: clamp(22px, 3vw, 30px); line-height: 1.1; margin: 0 0 14px; }
.titre-m { font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1.1; margin: 0; }
.surtitre { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent2); }
.grande-note { font-family: var(--display); font-size: 44px; line-height: 1; color: var(--accent2); }
.grande-note.petite { font-size: 28px; }
.note-accent { color: var(--accent2); font-weight: 700; }

/* en-tête */
.entete { display: flex; align-items: center; gap: 24px; padding: 14px clamp(16px, 4vw, 48px); border-bottom: var(--rule); }
.marque { font-family: var(--display); font-size: 28px; line-height: 1; color: var(--brand-color); text-decoration: none; white-space: nowrap; }
.marque.grande { font-size: 36px; margin-bottom: 8px; }
.nav { display: flex; gap: 4px; font-weight: 600; font-size: 14px; }
.nav a { text-decoration: none; padding: 8px 14px; color: var(--muted); border-radius: var(--radius-sm); }
.nav a[aria-current] { background: var(--accent); color: var(--on-accent); }
.recherche { margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--surface); border: var(--border); border-radius: var(--radius-sm); padding: 0 14px; height: 44px; width: min(280px, 30vw); color: var(--muted); }
.recherche input { border: 0; outline: none; background: transparent; color: var(--text); font: inherit; width: 100%; }
.rond { width: 44px; height: 44px; border-radius: var(--round); background: var(--surface); border: var(--border); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 44px; }
.rond.plein { background: var(--accent); color: var(--on-accent); border: 0; }
.avatar { width: 44px; height: 44px; border-radius: var(--round); background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 700; font-size: 14px; flex: 0 0 44px; }
.avatar.grand { width: 84px; height: 84px; font-family: var(--display); font-size: 30px; }
.bascule { margin: 0; }
html[data-mode="sombre"] .ico-lune, html[data-mode="clair"] .ico-soleil, html[data-mode="auto"] .ico-soleil { display: none; }
@media (prefers-color-scheme: dark) {
  html[data-mode="auto"] .ico-soleil { display: inline; }
  html[data-mode="auto"] .ico-lune { display: none; }
}

.page { padding: 28px clamp(16px, 4vw, 48px) 48px; max-width: 1440px; margin: 0 auto; display: flex; flex-direction: column; gap: 32px; }

/* éléments */
.carte { background: var(--surface); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: var(--radius-sm); font: 700 14px var(--body); text-decoration: none; cursor: pointer; }
.btn-accent { background: var(--accent); color: var(--on-accent); border: 0; }
.btn-ligne { background: transparent; color: var(--text); border: var(--border-strong); }
.btn.large { width: 100%; min-height: 50px; font-size: 15px; }
.puce { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 999px; background: var(--surface); border: var(--border); color: var(--text); font-weight: 700; font-size: 14px; text-decoration: none; }
.puce[aria-current] { background: var(--text); color: var(--bg); }
.puce.petite { height: 28px; padding: 0 12px; font-size: 12px; }
.pastille { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); }
.etoiles .plein { color: var(--accent2); }
.etoiles .vide { color: var(--line); }

/* accueil */
.haut { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; }
.une { display: grid; grid-template-columns: 230px minmax(0, 1fr); overflow: hidden; }
.une-affiche { width: 100%; height: 100%; min-height: 330px; object-fit: cover; background: var(--surface2); }
.une-texte { padding: 26px 30px; display: flex; flex-direction: column; gap: 8px; }
.une-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: auto; }
.une-actions .btn-accent { margin-left: auto; }
.resume { color: var(--muted); line-height: 1.6; margin: 4px 0; }
.resume.court { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.salons { padding: 20px 22px; display: flex; flex-direction: column; gap: 2px; }
.salons .titre-m { margin-bottom: 8px; }
.salon { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; }
.salon img { width: 40px; height: 56px; object-fit: cover; border-radius: var(--radius-xs); background: var(--surface2); }
.salon-texte { flex: 1; min-width: 0; }
.filtres { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filtres .titre-l { width: 100%; }
.tri { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
select, input, textarea { font: inherit; color: var(--text); }
.tri select, .formulaire select { height: 44px; padding: 0 12px; border-radius: var(--radius-sm); background: var(--surface); border: var(--border); }
.grille-affiches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 18px; }
.vignette { text-decoration: none; display: flex; flex-direction: column; gap: 6px; }
.affiche { position: relative; display: block; aspect-ratio: 2 / 3; background: var(--surface2); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.affiche img { width: 100%; height: 100%; object-fit: cover; }
.badge-note { position: absolute; right: 8px; bottom: 8px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--surface); color: var(--text); }
.vignette-titre { font-weight: 700; font-size: 14px; line-height: 1.25; }
.pagination { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }
.deux-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.classement { display: flex; align-items: center; gap: 16px; padding: 12px 14px; text-decoration: none; margin-bottom: 12px; }
.classement img { width: 54px; height: 80px; object-fit: cover; border-radius: var(--radius-xs); background: var(--surface2); }
.rang { font-family: var(--display); font-size: 40px; color: var(--accent2); width: 36px; text-align: center; }
.avis-court { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; text-decoration: none; margin-bottom: 12px; }

/* fiche */
.onglets-fiche { display: none; }
.fiche { display: grid; grid-template-columns: 250px minmax(0, 1fr) 360px; gap: 32px; align-items: start; }
.fiche-gauche { display: flex; flex-direction: column; gap: 12px; }
.fiche-affiche { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface2); }
.fiche-centre { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.genres { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.ticket { display: grid; grid-template-columns: 170px minmax(0, 1fr); overflow: hidden; }
.ticket-note { padding: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-right: 2px dashed var(--line); }
.ticket-jauges { padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; font-weight: 600; }
.jauge-ligne { display: grid; grid-template-columns: 100px minmax(0, 1fr) 32px; align-items: center; gap: 10px; }
.jauge { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; display: block; }
.jauge span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.liste-avis { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.avis { padding: 14px 16px; }
.avis-tete { display: flex; align-items: center; gap: 10px; }
.avis-texte { margin: 6px 0 0; color: var(--muted); white-space: pre-line; }
.formulaire { padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.etoiles-saisie { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.etoiles-saisie input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.etoiles-saisie label { font-size: 34px; line-height: 1; color: var(--line); cursor: pointer; padding: 2px; min-width: 44px; text-align: center; }
.etoiles-saisie input:checked ~ label, .etoiles-saisie label:hover, .etoiles-saisie label:hover ~ label { color: var(--accent2); }
.etoiles-saisie input:focus-visible + label { outline: 3px solid var(--accent2); }
.qualites-saisie { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; font-size: 14px; font-weight: 600; }
.qualites-saisie label, .bloc { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
textarea, .bloc input { width: 100%; padding: 10px 12px; border-radius: var(--radius-xs); background: var(--bg); border: var(--border); min-height: 44px; }
.actions { display: flex; gap: 10px; }
.chat { display: flex; flex-direction: column; height: calc(100vh - 140px); min-height: 460px; position: sticky; top: 20px; overflow: hidden; }
.chat-tete { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.point { width: 8px; height: 8px; border-radius: 50%; background: var(--accent2); }
.chat-fil { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.msg { align-self: flex-start; max-width: 85%; }
.msg .qui { font-size: 12px; font-weight: 700; color: var(--accent2); margin-bottom: 3px; }
.msg .bulle { background: var(--bg); border-radius: var(--radius-xs); padding: 8px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.moi { align-self: flex-end; }
.msg.moi .qui { color: var(--muted); text-align: right; font-weight: 600; }
.msg.moi .bulle { background: var(--accent); color: var(--on-accent); }
.chat-saisie { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-saisie input { flex: 1; height: 44px; border-radius: var(--radius-sm); background: var(--bg); border: var(--border); padding: 0 14px; min-width: 0; }

/* profil */
.profil { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 40px; align-items: start; }
.profil-gauche { display: flex; flex-direction: column; gap: 14px; }
.profil-carte { padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; margin-top: 8px; }
.stats > div { background: var(--bg); border-radius: var(--radius-xs); padding: 10px; }
.profil-droite { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.formulaire-profil { display: flex; flex-direction: column; gap: 26px; }
.formulaire-profil legend { margin-bottom: 12px; }
.choix-univers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.miniature { position: relative; display: block; aspect-ratio: 1280 / 800; overflow: hidden; background: var(--surface2); border-bottom: var(--border); }
.miniature iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 800px; border: 0; transform-origin: 0 0; pointer-events: none; }
.profil.seul { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1101px) { .profil.seul .choix-univers { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.bienvenue { padding: 24px 28px; }
.bienvenue p { margin: 0; color: var(--muted); max-width: 70ch; line-height: 1.6; }
html[data-apercu] body { overflow: hidden; }
.carte-univers { position: relative; display: flex; flex-direction: column; background: var(--surface); border: var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; }
.carte-univers input { position: absolute; opacity: 0; }
.carte-univers:has(input:checked) { outline: 3px solid var(--accent); outline-offset: 2px; }
.carte-univers:has(input:focus-visible) { outline: 3px solid var(--accent2); }
.apercu { height: 100px; display: flex; align-items: flex-end; padding: 12px; gap: 8px; }
.apercu .aa { font-size: 38px; line-height: 1; }
.pastilles { margin-left: auto; display: flex; gap: 4px; }
.pastilles span { width: 18px; height: 18px; border-radius: 50%; display: block; }
.carte-univers-texte { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.choix-mode { display: inline-flex; gap: 6px; background: var(--surface); border: var(--border); border-radius: var(--radius-sm); padding: 5px; flex-wrap: wrap; }
.choix-mode label { position: relative; }
.choix-mode input { position: absolute; opacity: 0; }
.choix-mode span { display: inline-flex; align-items: center; height: 44px; padding: 0 18px; border-radius: var(--radius-sm); font-weight: 700; cursor: pointer; }
.choix-mode input:checked + span { background: var(--accent); color: var(--on-accent); }
.choix-mode input:focus-visible + span { outline: 3px solid var(--accent2); }
.case { display: flex; align-items: center; gap: 12px; }
.case input { width: 20px; height: 20px; accent-color: var(--accent); }
.message-ok { padding: 12px 16px; }

/* connexion */
.connexion { display: flex; justify-content: center; padding-top: 6vh; }
.connexion .formulaire { width: min(420px, 100%); }
.erreur { color: var(--accent); font-weight: 700; margin: 0; }

/* navigation mobile */
.barre-onglets { display: none; }

@media (max-width: 1100px) {
  .haut { grid-template-columns: 1fr; }
  .fiche { grid-template-columns: 220px minmax(0, 1fr); }
  .chat { grid-column: 1 / -1; position: static; height: 70vh; }
}
@media (max-width: 760px) {
  body { padding-bottom: 76px; }
  .entete { gap: 10px; flex-wrap: wrap; }
  .nav, .avatar:not(.grand) { display: none; }
  .bascule { margin-left: auto; }
  .recherche { order: 3; width: 100%; margin-left: 0; }
  .marque { font-size: 24px; }
  .page { gap: 24px; padding-top: 16px; }
  .une { grid-template-columns: 110px minmax(0, 1fr); }
  .une-affiche { min-height: 165px; }
  .une-texte { padding: 14px; }
  .une .resume, .une-actions .btn-ligne { display: none; }
  .une-actions .btn-accent { margin-left: 0; width: 100%; }
  .grille-affiches { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; }
  .deux-col { grid-template-columns: 1fr; }
  .tri { margin-left: 0; width: 100%; }
  .onglets-fiche { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 2; }
  .onglets-fiche a { text-align: center; padding: 12px 0; font-weight: 700; text-decoration: none; }
  .fiche { grid-template-columns: 1fr; gap: 20px; }
  .fiche-gauche { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; }
  .fiche-affiche { grid-row: span 2; }
  .ticket { grid-template-columns: 120px minmax(0, 1fr); }
  .qualites-saisie { grid-template-columns: 1fr; }
  .chat { height: 75vh; min-height: 420px; }
  .profil { grid-template-columns: 1fr; }
  .choix-univers { grid-template-columns: 1fr; gap: 14px; }
  .barre-onglets { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--surface); border-top: var(--rule); padding: 6px 4px calc(10px + env(safe-area-inset-bottom)); }
  .barre-onglets a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 700; min-height: 44px; }
  .barre-onglets a[aria-current] { color: var(--accent); }
}
