:root {
  --ink: #14161c;
  --paper: #e9ecf2;
  --bg: #050507;
  --black: #111318;
  --signal: #ffc53d;
  --muted: #9aa1b2;
  --error: #ff8b7d;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: clamp(20px, 6vh, 56px) 16px;
  background: var(--bg);
  color: var(--paper);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-stretch: 100%;
  line-height: 1.4;
}

.wrap { width: 100%; max-width: 34rem; }

/* ---------- Nom : le seul geste marqué de la page ---------- */
.head { container-type: inline-size; margin-bottom: 28px; }

.head h1 {
  font-size: 20.5cqw;
  font-weight: 900;
  font-stretch: 125%;
  line-height: 0.88;
  letter-spacing: -0.045em;
  margin-left: -0.04em; /* aligne l'optique de la première lettre sur la colonne */
}

.head p {
  margin-top: 14px;
  font-size: 1.05rem;
  font-weight: 450;
  color: var(--muted);
}

/* ---------- Colonne de l'échiquier ---------- */
.board { display: flex; flex-direction: column; gap: 10px; }

.item {
  --sq-bg: var(--black);
  --sq-fg: var(--paper);
  background: var(--sq-bg);
  color: var(--sq-fg);
  border-radius: 18px;
  overflow: hidden;
  animation: place 0.55s cubic-bezier(0.2, 0.7, 0.1, 1) both;
}

/* au survol, la case s'inverse, comme un coup joué */
.item:hover { --sq-bg: var(--paper); --sq-fg: var(--ink); }

.item:nth-child(1) { animation-delay: 0.10s; }
.item:nth-child(2) { animation-delay: 0.19s; }
.item:nth-child(3) { animation-delay: 0.28s; }
.item:nth-child(4) { animation-delay: 0.37s; }

@keyframes place {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}

.link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 92px;
  padding: 16px 20px;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.link:focus-visible { outline: 4px solid var(--signal); outline-offset: -4px; }

.text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.text strong {
  font-size: clamp(1.7rem, 7.5vw, 2.15rem);
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.text small {
  font-size: 0.95rem;
  font-weight: 450;
  opacity: 0.78;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* pastille blanche : les logos SVGL gardent leurs couleurs sur les deux teintes de case */
.icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 12px;
}
.icon img { display: block; width: 30px; height: 30px; }

/* ---------- Vérification : s'ouvre sous la case cliquée ---------- */
.pop {
  display: grid;
  grid-template-rows: 0fr;
  background: var(--signal);
  transition: grid-template-rows 0.25s ease;
}
.pop-inner { overflow: hidden; min-height: 0; padding: 0 14px; }
.item.open .pop { grid-template-rows: 1fr; }
.item.open .pop-inner { padding: 14px; }

.pop-inner > cap-widget {
  --cap-widget-width: 100%;
  --cap-background: #f4f5f8;
  --cap-color: var(--ink);
  --cap-border-color: var(--ink);
  --cap-border-radius: 12px;
  --cap-checkbox-border-radius: 7px;
  --cap-checkbox-border: 2px solid var(--ink);
  --cap-checkbox-background: #fff;
  --cap-spinner-color: var(--ink);
  --cap-spinner-background-color: #d4d8e2;
  display: block;
  width: 100%;
}

.item.error .pop { background: var(--error); }

/* ---------- Statut et pied de page ---------- */
.status {
  min-height: 1.5em;
  margin-top: 18px;
  font-size: 0.95rem;
  color: var(--muted);
  opacity: 0;
}
.status.show { opacity: 1; }
.status.err { color: var(--error); }

.foot {
  margin-top: 28px;
  max-width: 30rem;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--muted);
}
.foot p + p { margin-top: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
