:root {
  color-scheme: light;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --petrole: #26495c;
  --nuit: #122e3d;
  --or: #c4a35a;
  --encre: #142e3c;
  --texte-secondaire: #4a6371;
  --trait: #dce5eb;
  --fond: #f3f6f8;
  color: var(--encre);
  background: var(--fond);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
body > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px max(16px, calc((100% - 1120px) / 2));
  background: var(--nuit);
  color: white;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; line-height: 1.15; }
.brand img { width: 43px; height: 43px; object-fit: contain; }
.brand span { color: #e8cf93; }
header .quiet { background: #254759; color: white; font-size: .86rem; }
main { max-width: 1160px; margin: auto; padding: 28px 20px max(48px, env(safe-area-inset-bottom)); }
h1, h2, h3, p { margin: 0 0 10px; overflow-wrap: anywhere; }
h1 { font-size: clamp(2rem, 5.5vw, 3.4rem); line-height: 1.04; letter-spacing: -.052em; }
h2 { font-size: 1.32rem; letter-spacing: -.026em; }
h3 { font-size: 1.06rem; margin-bottom: 4px; }
.panel, .card {
  border: 1px solid var(--trait);
  background: white;
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 4px 14px #14324308;
}
.panel { margin-bottom: 12px; }
.login { max-width: 440px; margin: clamp(18px, 6vh, 60px) auto; padding: clamp(22px, 6vw, 38px); }
.login-logo { width: 122px; display: block; margin: 0 auto 22px; }
.login h1 { font-size: clamp(1.7rem, 6vw, 2.45rem); text-align: center; margin-bottom: 22px; }
.login form { display: grid; }
.login form button { justify-content: center; }
.club-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  margin: 12px 0 18px;
  padding: clamp(20px, 5vw, 44px);
  border-radius: 24px;
  background: radial-gradient(ellipse at 92% 10%, #355c70, transparent 70%), var(--nuit);
  color: white;
}
.club-hero img { width: clamp(58px, 14vw, 136px); }
.club-hero p { color: #e1ebf0; margin-top: 15px; }
progress { display: block; width: 100%; height: 6px; border: 0; border-radius: 20px; appearance: none; background: #e3eaf0; overflow: hidden; }
progress::-webkit-progress-bar { background: transparent; }
progress::-webkit-progress-value { background: var(--or); border-radius: 20px; }
progress::-moz-progress-bar { background: var(--or); border-radius: 20px; }
.club-hero progress { max-width: 400px; background: #ffffff28; }
.grid { display: grid; gap: 9px; }
.layout { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(0, 2.5fr); gap: 28px; margin-top: 24px; }
.card { display: block; text-align: left; width: 100%; color: var(--encre); overflow-wrap: anywhere; }
.card strong { font-size: 1.12rem; }
.card small, .joueur small { display: block; color: var(--texte-secondaire); font-weight: 500; }
.card progress { margin-top: 8px; }
.card.selected { background: #fff9eb; border-color: #b19554; box-shadow: inset 3px 0 var(--or); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
button, .button {
  background: var(--petrole); color: white; border: 1px solid transparent; border-radius: 12px;
  min-height: 44px; padding: 8px 14px; font: inherit; font-weight: 650;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; cursor: pointer;
  transition: background-color .16s ease, box-shadow .16s ease;
}
button.card { display: block; padding: 12px 14px; }
.quiet { background: #e7eef3; color: var(--nuit); }
.primary, label.button:first-child { background: var(--or); color: #192b36; }
@media (hover: hover) {
  button:hover, .button:hover { box-shadow: inset 0 0 0 50px #122e3d13; }
}
:focus-visible, .button:focus-within { outline: 2px solid #825f1d; outline-offset: 3px; }
.file { position: absolute; opacity: 0; width: 1px; height: 1px; padding: 0; }
form { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
label { display: block; font-weight: 600; }
input, select { display: block; width: 100%; min-width: 0; max-width: 100%; font: inherit; border: 1px solid #aebfca; border-radius: 10px; padding: 9px; margin-top: 4px; }
summary { cursor: pointer; color: var(--petrole); font-weight: 650; min-height: 34px; }
details { margin: 10px 0; }
.joueur img, #equipe-active .panel img { display: block; max-width: 100%; max-height: 250px; object-fit: contain; margin: 10px 0; border-radius: 12px; }
#message { padding: 12px 16px; background: #e4eef5; border-radius: 12px; }
#message.error { background: #ffe5e1; color: #852318; }
.success { color: #165749; }
[hidden] { display: none !important; }
button:disabled, input:disabled { opacity: .6; }
@media (max-width: 700px) {
  main { padding-inline: 14px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #equipe-active { scroll-margin-top: 14px; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

#controle-photo {
  width: min(94vw, 560px);
  max-height: 92dvh;
  border: 1px solid var(--trait);
  border-radius: 20px;
  padding: 18px;
  color: var(--encre);
}
#controle-photo::backdrop { background: #122e3dc9; }
.cadre-photo {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  overflow: hidden;
  border-radius: 12px;
}
.cadre-photo > img, .cadre-photo > video {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(47vh, 500px);
}
.repere-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  fill: none;
  stroke: #ffe3a2;
  stroke-width: 2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px #122e3d);
}
.repere-photo path { vector-effect: non-scaling-stroke; }
.repere-pointille { stroke-dasharray: 4px 5px; }
.repere-portrait, .portrait .repere-groupe, .masquer-repere .repere-photo { display: none; }
.portrait .repere-portrait { display: inline; }
#option-repere { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
#option-repere input { width: auto; margin: 0; accent-color: var(--petrole); }
#etat-photo { margin-top: 12px; }

#controle-photo[open] {
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  max-height: 88dvh;
  overflow: hidden;
  padding: 14px;
}
#titre-photo { flex: none; }
.contenu-photo {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.actions-photo {
  flex: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--trait);
  padding-top: 8px;
  margin: 8px 0 0;
}
.actions-photo > button, .actions-photo > label {
  justify-content: center;
  text-align: center;
  padding-inline: 5px;
  font-size: .9rem;
  line-height: 1.15;
}
#valider-photo { grid-column: 2; grid-row: 1; background: var(--or); color: var(--nuit); }
#option-repere { font-size: .9rem; }
#etat-photo { margin: 6px 0 0; font-size: .9rem; }

.zone-yeux { fill: #ffe3a2; fill-opacity: .13; stroke: none; }

.revue-equipe { margin-top: 20px; }
.revue-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: 8px;
}
.revue-joueur { min-width: 0; padding: 10px; }
.revue-joueur h3 { overflow-wrap: anywhere; }
.revue-joueur small { display: block; color: var(--texte-secondaire); }
.revue-joueur img { width: 100%; }
.revue-joueur .actions > button { width: 100%; justify-content: center; }

#comparaison-photo figure { margin: 0; min-width: 0; }
#comparaison-photo.comparer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}
#comparaison-photo figcaption {
  font-size: .85rem;
  font-weight: 650;
  text-align: center;
  margin-bottom: 4px;
}
#portrait-actuel img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(47vh, 500px);
  margin-inline: auto;
  border-radius: 12px;
}
#affectations-photo {
  font-size: .9rem;
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}

.navigation-club {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 8px;
  padding: 8px 0;
  background: var(--fond);
}
.navigation-club:empty { display: none; }
#equipe-active { scroll-margin-top: 68px; }
.accueil-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 10px;
}
button.accueil-carte { display: flex; align-items: flex-start; gap: 12px; }
.numero-etape {
  display: grid;
  place-items: center;
  flex: 0 0 33px;
  height: 33px;
  border-radius: 9px;
  background: var(--or);
  color: var(--nuit);
  font-weight: 750;
}

.contenu-album textarea {
  display: block;
  width: 100%;
  margin: .35rem 0;
  padding: .6rem;
  font: inherit;
  color: inherit;
  border: 1px solid #c1d0d8;
  border-radius: .55rem;
  resize: vertical;
}
.texte-album { white-space: pre-wrap; overflow-wrap: anywhere; }
