/* Page de statut : couleurs du site (bleu nuit et or), tableau de bord inspiré de status.ppy.sh. Courbes : une
   couleur par mesure (processeur bleu, joueurs or, mémoire vert d'eau, réseau violet, temps de réponse orange),
   jeu de couleurs vérifié sur fond sombre (écarts de teinte, daltonisme, contraste). */
:root {
  --bg: #0e131d;
  --panel: rgba(22, 27, 40, 0.92);
  --surface: #161b28;
  --cell: rgba(10, 13, 21, 0.9);
  --trim: #c2ad78;
  --trim-soft: rgba(194, 173, 120, 0.45);
  --trim-faint: rgba(194, 173, 120, 0.22);
  --gold-text: #f3dca2;
  --gold-hi: #ffde80;
  --text: #ece8de;
  --hint: #b9b2a3;
  --cpu: #3987e5;
  --cpu-soft: #2a5d9e;
  --bad-text: #f2907e;
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 "Segoe UI", system-ui, sans-serif; }
a { color: var(--gold-hi); }
.hint { color: var(--hint); font-weight: 400; }

/* Barre du haut : titre et période */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px; border-bottom: 1px solid var(--trim-faint); background: #0b0f17; }
.top h1 { margin: 0; font: 600 18px var(--serif); color: var(--gold-text); }
.range { display: flex; gap: 4px; }
.range button { background: var(--cell); color: var(--hint); border: 1px solid var(--trim-faint); border-radius: 4px; padding: 4px 10px;
  font: inherit; font-size: 13px; cursor: pointer; }
.range button:hover { color: var(--text); }
.range button[aria-pressed="true"] { color: var(--gold-hi); border-color: var(--trim); }
.range button:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }

.wrap { max-width: 1600px; margin: 0 auto; padding: 14px 20px 32px; display: grid; gap: 10px; }

/* Bandeau : l'image officielle */
.banner { display: block; height: 200px; border-radius: 6px; overflow: hidden; border: 1px solid var(--trim-soft); }
.banner img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 78%; }
.intro { background: var(--panel); border: 1px solid var(--trim-soft); border-radius: 6px; padding: 10px 18px; }
.intro ul { margin: 4px 0; padding-left: 20px; }
.stale { margin: 6px 0 2px; color: var(--bad-text); font-weight: 600; }

/* Tuiles de disponibilité (sur la période choisie) */
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.tile { border-radius: 6px; padding: 8px 12px; color: #fff; background: #3a3f4b; }
.tile.up { background: #0b6b0b; }
.tile.warn { background: #8a5b00; }
.tile.down { background: #9e2a2a; }
.tile h2 { margin: 0; font-size: 14px; display: flex; justify-content: space-between; gap: 6px; }
.tile h2 small { background: rgba(0, 0, 0, .25); border-radius: 3px; padding: 0 6px; font-weight: 400; }
.tile p { margin: 2px 0 0; text-align: center; font-size: 30px; font-weight: 600; line-height: 1.3; }
.tile .now { display: block; text-align: center; font-size: 13px; min-height: 19px; }

/* Cadres et rangées */
.row { display: grid; gap: 10px; }
.cpu { grid-template-columns: 400px minmax(0, 1fr); }
.r2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.r3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel { background: var(--panel); border: 1px solid var(--trim-faint); border-radius: 6px; padding: 8px 12px; min-width: 0; }
.panel h2 { margin: 0 0 4px; font-size: 13px; color: var(--hint); font-weight: 600; }
.big { margin: 14px 0 18px; text-align: center; font-size: 60px; font-weight: 600; line-height: 1.15; }
.big small { display: block; margin-top: 4px; font-size: 14px; color: var(--hint); font-weight: 400; line-height: 1.2; }

/* Cœurs de la machine, maintenant : celui du fil principal du jeu ressort */
.cores { display: flex; gap: 4px; }
.core { flex: 1; min-width: 0; display: grid; grid-template-rows: 90px auto auto; justify-items: center; gap: 2px; font-size: 11px; }
.core span { width: 100%; align-self: end; border-radius: 3px 3px 0 0; background: var(--cpu-soft); min-height: 2px; }
.core.game span { background: var(--cpu); }
.core b { font-weight: 600; white-space: nowrap; }
.core small { color: var(--hint); }
.cores.many .core b { display: none; }
.cores-note { margin: 6px 0 0; font-size: 12px; color: var(--hint); text-align: center; }
.cores-note i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--cpu); margin-right: 5px; vertical-align: -1px; }

/* Courbes */
.chart { position: relative; min-height: 60px; }
.chart svg { display: block; touch-action: pan-y; }
.chart .grid { stroke: rgba(236, 232, 222, .08); }
.chart .ax { fill: var(--hint); font-size: 11px; }
.chart .limit { stroke: var(--bad-text); stroke-dasharray: 4 4; stroke-width: 1; }
.chart .cross { stroke: rgba(236, 232, 222, .35); }
.chart .empty { fill: var(--hint); font-size: 13px; }
.tip { position: absolute; top: 4px; padding: 3px 8px; border-radius: 4px; background: #0a0d15; border: 1px solid var(--trim-soft);
  font-size: 12px; white-space: nowrap; pointer-events: none; }

/* Sections repliables */
details { border-radius: 6px; }
summary { list-style: none; cursor: pointer; padding: 11px; text-align: center; font: 700 17px var(--serif); color: var(--gold-text);
  background: linear-gradient(180deg, #2a3350, #1a2135); border: 1px solid var(--trim-soft); border-radius: 6px; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "›"; display: inline-block; margin-right: 10px; transition: transform .15s; }
details[open] summary::before { transform: rotate(90deg); }
details > .row { margin-top: 10px; }

.foot { margin-top: 8px; text-align: center; color: var(--hint); font-size: 13px; }

@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .cpu, .r2, .r3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .top { flex-wrap: wrap; padding: 10px 16px; }
  .wrap { padding: 12px 16px 24px; }
  .banner { height: 120px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .big { font-size: 44px; }
}
