:root {
  color-scheme: dark;
  --fond: #0f0f13;
  --surface: #1a1a21;
  --surface-2: #24242d;
  --bord: #33333f;
  --texte: #f2f2f5;
  --discret: #9a9aa8;
  --accent: #e10600;
  --accent-fonce: #b30500;
  --or: #d4af37;
  --argent: #c0c4cc;
  --bronze: #cd7f32;
  --rayon: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 50% -200px, rgba(225, 6, 0, .18), transparent 70%),
    var(--fond);
  color: var(--texte);
  font: 17px/1.55 "Titillium Web", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

a { color: inherit; }

/* En-tête : bande damier + logo + menu */
.haut {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(15, 15, 19, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bord);
}

.haut::before {
  content: "";
  display: block;
  height: 6px;
  background: repeating-conic-gradient(#fff 0 25%, #111 0 50%) 0 0 / 12px 12px;
}

.haut-contenu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 10px 16px;
}

.logo { display: block; height: 52px; width: auto; max-width: 100%; }

nav { display: flex; gap: 4px; overflow-x: auto; }

nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--discret);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
  transition: color .15s, background .15s;
}

nav a:hover { color: var(--texte); background: var(--surface-2); }
nav a.actif { color: #fff; background: var(--accent); }

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 16px 48px;
}

/* Cartes */
.carte {
  background: var(--surface);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  padding: 28px;
  margin-bottom: 20px;
}

.etroite { max-width: 600px; margin-left: auto; margin-right: auto; }

h1, h2 {
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .02em;
  line-height: 1.15;
}

h1 { margin: 0 0 20px; font-size: 1.7rem; }
h1::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: .9em;
  margin-right: 12px;
  background: var(--accent);
  transform: skewX(-15deg);
  vertical-align: -.05em;
}

h2 { margin: 28px 0 12px; font-size: 1.1rem; color: var(--discret); }

.discret { color: var(--discret); font-size: .92rem; }

/* Accueil */
.news { white-space: pre-line; font-size: 1.15rem; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.photos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.photos img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 6px;
  clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
  transition: transform .3s;
}

.photos img:hover { transform: scale(1.03); }

/* Formulaires */
label { display: block; font-weight: 700; margin: 16px 0 6px; }

input[type=text], input[type=password], input[type=file], select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--bord);
  border-radius: 8px;
  font: inherit;
  background: var(--surface-2);
  color: var(--texte);
  transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(225, 6, 0, .25);
}

textarea { min-height: 220px; resize: vertical; }

/* Classement façon « timing tower » */
.place {
  display: grid;
  grid-template-columns: 60px 1fr;
  margin: 6px 0;
}

.place span {
  display: grid;
  place-items: center;
  border-radius: 8px 0 0 8px;
  background: #fff;
  color: #111;
  font-weight: 900;
  font-style: italic;
}

.place select { border-radius: 0 8px 8px 0; }

.place-1 span { background: var(--or); }
.place-2 span { background: var(--argent); }
.place-3 span { background: var(--bronze); }

/* Boutons */
.boutons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.bouton, button {
  display: inline-block;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, transform .1s;
}

.bouton:hover, button:hover { background: var(--accent-fonce); }
.bouton:active, button:active { transform: translateY(1px); }
.bouton.secondaire, button.secondaire { background: var(--surface-2); color: var(--texte); border-color: var(--bord); }
.bouton.secondaire:hover, button.secondaire:hover { background: var(--bord); }

/* Messages */
.erreur, .succes {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 18px;
  border-left: 4px solid;
}

.erreur { background: rgba(225, 6, 0, .12); border-color: var(--accent); color: #ffb4b0; }
.succes { background: rgba(34, 197, 94, .12); border-color: #22c55e; color: #a7f3c0; }
.succes a { font-weight: 700; }

/* Récapitulatif des pronostics */
.recap { width: 100%; border-collapse: separate; border-spacing: 0 6px; margin: 8px 0; }
.recap td { padding: 10px 14px; background: var(--surface-2); }
.recap td:first-child {
  width: 64px;
  border-radius: 8px 0 0 8px;
  background: #fff;
  color: #111;
  font-weight: 900;
  font-style: italic;
  text-align: center;
}
.recap td:last-child { border-radius: 0 8px 8px 0; font-weight: 600; }
.recap tr:nth-child(1) td:first-child { background: var(--or); }
.recap tr:nth-child(2) td:first-child { background: var(--argent); }
.recap tr:nth-child(3) td:first-child { background: var(--bronze); }

/* Tableau Excel des résultats : on le garde sur fond blanc, comme dans Excel */
.resultats {
  overflow-x: auto;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  color: #000;
  color-scheme: light;
}

pre { white-space: pre-wrap; background: var(--surface-2); padding: 14px; border-radius: 8px; }

/* Admin */
.admin-menu .bouton { display: block; margin: 10px 0; text-align: center; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .carte { padding: 20px 16px; }
  h1 { font-size: 1.4rem; }
  .logo { height: 40px; }
  .photos { grid-template-columns: 1fr; }
  .photos img { clip-path: none; }
}

@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #000; }
  .haut, .boutons, .actions { display: none; }
  .carte { border: 0; padding: 0; background: none; }
  .recap td { background: none; color: #000; border-bottom: 1px solid #ccc; }
}
