:root {
  --bg: #0f1116;
  --surface: #181b22;
  --surface2: #20242d;
  --line: #2a2f3a;
  --text: #e7e9ee;
  --text-dim: #9aa1ad;
  --text-faint: #6b7280;
  --accent: #8b7cff;        /* violet arcane */
  --accent-soft: rgba(139, 124, 255, .15);
  --brass: #d9b25a;         /* prix / accents chauds */
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 500px at 50% -200px, rgba(139, 124, 255, .10), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* En-tête */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
  background: rgba(15, 17, 22, .82); backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px; transform: rotate(45deg);
  background: linear-gradient(135deg, var(--accent), #5b46d6);
  box-shadow: 0 0 16px rgba(139, 124, 255, .5);
}
.brand-name { font-weight: 800; letter-spacing: -.02em; font-size: 18px; }
.brand-dim { color: var(--text-faint); font-weight: 600; }
.count { font-size: 13px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* Zone principale */
.main { max-width: 1180px; margin: 0 auto; padding: 26px 20px 80px; }

/* Recherche */
.search {
  position: relative; max-width: 640px; margin: 14px auto 6px;
}
.search-ic {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 19px; height: 19px; color: var(--text-faint); pointer-events: none;
}
#q {
  width: 100%; padding: 15px 18px 15px 46px; font-size: 16px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
#q::placeholder { color: var(--text-faint); }
#q:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.status { text-align: center; color: var(--text-dim); font-size: 14px; margin: 18px 0 22px; min-height: 18px; }
.status .spin {
  display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 7px;
  border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Grille de cartes */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}
.card {
  cursor: pointer; border: none; background: none; padding: 0; text-align: left;
  display: flex; flex-direction: column; gap: 8px;
}
.card-img {
  position: relative; aspect-ratio: 488 / 680; border-radius: var(--radius);
  overflow: hidden; background: var(--surface2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  transition: transform .16s ease, box-shadow .16s ease;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-img .ph {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 10px;
  text-align: center; font-size: 12.5px; font-weight: 600; color: var(--text-dim);
  background: var(--surface2);
}
.card:hover .card-img { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(0, 0, 0, .5), 0 0 0 1.5px var(--accent); }
.card:focus-visible .card-img { box-shadow: 0 0 0 3px var(--accent); }
.card-meta { padding: 0 2px; }
.card-name { font-size: 13px; font-weight: 600; line-height: 1.25; }
.card-sub { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; display: flex; justify-content: space-between; gap: 8px; }
.card-price { color: var(--brass); font-variant-numeric: tabular-nums; white-space: nowrap; }

.more-wrap { text-align: center; margin-top: 28px; }
.more {
  padding: 10px 20px; font-size: 14px; font-weight: 600; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.more:hover { border-color: var(--accent); }

/* Fiche carte (panneau) */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(6, 7, 10, .72); backdrop-filter: blur(3px); }
.sheet-panel {
  position: relative; width: 100%; max-width: 760px; max-height: 88vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px; display: grid; grid-template-columns: 260px 1fr; gap: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.sheet-img { width: 100%; border-radius: var(--radius); display: block; background: var(--surface2); }
.sheet-info h2 { margin: 0 0 4px; font-size: 21px; letter-spacing: -.01em; }
.sheet-set { color: var(--text-dim); font-size: 13px; margin-bottom: 14px; }
.sheet-line { font-size: 14px; color: var(--text); margin: 0 0 6px; }
.sheet-type { color: var(--accent); font-weight: 600; }
.sheet-text { white-space: pre-wrap; font-size: 14px; line-height: 1.55; color: var(--text); background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.sheet-prices { display: flex; gap: 18px; margin: 12px 0; }
.sheet-prices b { color: var(--brass); font-size: 17px; }
.sheet-prices span { display: block; font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .5px; }
.sheet-legal { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.legal { font-size: 11px; padding: 2px 9px; border-radius: 20px; border: 1px solid var(--line); color: var(--text-dim); }
.legal.ok { color: #57d28a; border-color: rgba(87, 210, 138, .35); background: rgba(87, 210, 138, .08); }
.sheet-close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface2); color: var(--text-dim); font-size: 18px; cursor: pointer; line-height: 1; }
.sheet-close:hover { color: var(--text); border-color: var(--accent); }

@media (max-width: 560px) {
  .sheet-panel { grid-template-columns: 1fr; max-height: 92vh; }
  .sheet-img { max-width: 220px; margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
