/* PROTOTYPE — rendu partagé de la Carte, design « Brute » retenu (photo telle quelle, cf. NOTES.md). */
:root {
  --r-commun: #8d8a84; --r-peu: #3f9a5b; --r-rare: #2f6fd6; --r-epique: #8a46d4; --r-legend: #d49a1c; --r-myth: #e0457b;
  --f-aliment: #d9822b; --f-boisson: #1f8a9e;
  --ns-A: #038141; --ns-B: #85bb2f; --ns-C: #fecb02; --ns-D: #ee8100; --ns-E: #e63e11;
}

a.card { display: block; text-decoration: none; color: inherit; }
.card[data-r="Commun"] { --r: var(--r-commun); } .card[data-r="Peu commun"] { --r: var(--r-peu); }
.card[data-r="Rare"] { --r: var(--r-rare); } .card[data-r="Épique"] { --r: var(--r-epique); }
.card[data-r="Légendaire"] { --r: var(--r-legend); } .card[data-r="Mythique"] { --r: var(--r-myth); }
.card[data-f="Aliment"] { --f: var(--f-aliment); } .card[data-f="Boisson"] { --f: var(--f-boisson); }
@keyframes holo { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
/* Carte physique en 3D : inclinaison pilotée par carte.js (--rx, --ry, --mx, --my, --glare). */
@property --rx { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --ry { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.fc { width: 250px; height: 350px; border-radius: 14px; padding: 7px; background: var(--r); position: relative; box-shadow: 0 6px 18px rgb(0 0 0 / .4);
      transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) scale(var(--s, 1)); transform-origin: 50% 50%;
      transition: transform .6s cubic-bezier(.2, .8, .2, 1), box-shadow .3s; will-change: transform; }
.fc.tilting { transition: transform .06s linear, box-shadow .3s; box-shadow: 0 18px 36px rgb(0 0 0 / .5); }
.fc::after { content: ""; position: absolute; inset: 0; border-radius: 14px; pointer-events: none; z-index: 3;
             background: radial-gradient(circle at var(--mx, 50%) var(--my, 30%), rgb(255 255 255 / .55), rgb(255 255 255 / 0) 55%);
             mix-blend-mode: soft-light; opacity: var(--glare, 0); transition: opacity .3s; }
.fc .in { position: relative; background: #fbf8f1; color: #1d1c1a; border-radius: 9px; height: 100%; display: flex; flex-direction: column; overflow: hidden; text-align: left; }
.fc[data-r="Épique"] .in::after, .fc[data-r="Légendaire"] .in::after, .fc[data-r="Mythique"] .in::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2; mix-blend-mode: color-dodge;
  background: linear-gradient(115deg, transparent 25%, rgb(255 111 165 / .35), rgb(255 211 110 / .3), rgb(126 240 195 / .35), rgb(111 183 255 / .35), transparent 75%);
  background-size: 260% 260%; background-position: var(--mx, 50%) var(--my, 50%); opacity: calc(var(--glare, 0) * .9); transition: opacity .3s; }
@keyframes cardfloat { 0%, 100% { --ry: -10deg; --rx: 3deg; } 50% { --ry: 10deg; --rx: -3deg; } }
.fc.float { animation: cardfloat 5s ease-in-out infinite; }
.fc.float[data-r="Mythique"], .fc.float[data-r="Légendaire"] { animation: cardfloat 5s ease-in-out infinite, holo 6s linear infinite; }
@media (prefers-reduced-motion: reduce) { .fc.float { animation: none; } .fc { transition: none; } }
.fc[data-r="Mythique"] { background: linear-gradient(115deg, #ff6fa5, #ffd36e, #7ef0c3, #6fb7ff, #c58cff, #ff6fa5); background-size: 200% 100%; animation: holo 6s linear infinite; }
.fc[data-r="Légendaire"] { background: linear-gradient(115deg, #b8860b, #ffe08a, #c9971f, #fff3c4, #b8860b); background-size: 200% 100%; animation: holo 6s linear infinite; }
.fc p { margin: 0; }

/* Éléments communs */
.fc .nm { font: 400 14px/1.1 "Archivo Black"; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
/* Nutri-Score en bandeau sur la photo, comme sur les emballages : la lettre du produit agrandie */
.fc .ns-logo { position: absolute; left: 5px; bottom: 5px; z-index: 1; background: #fff; border-radius: 7px; padding: 2px 3px 3px; box-shadow: 0 1px 4px rgb(0 0 0 / .35); }
.fc .ns-logo .t { display: block; font: 800 5px/1 Inter; letter-spacing: .1em; color: #6b6b6b; text-align: center; margin: 1px 0 2px; }
.fc .ns-logo .l { display: flex; align-items: center; }
.fc .ns-logo i { font-style: normal; width: 12px; height: 14px; display: grid; place-items: center; font: 800 8px Inter; color: rgb(255 255 255 / .7); background: var(--ns); }
.fc .ns-logo i:first-child { border-radius: 4px 0 0 4px; } .fc .ns-logo i:last-child { border-radius: 0 4px 4px 0; }
.fc .ns-logo i.on { position: relative; z-index: 1; width: 17px; height: 20px; margin: -3px -2px; border-radius: 5px; border: 1.5px solid #fff; font-size: 12px; color: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .3); }
.fc .ns-logo i[data-ns="A"] { --ns: var(--ns-A); } .fc .ns-logo i[data-ns="B"] { --ns: var(--ns-B); } .fc .ns-logo i[data-ns="C"] { --ns: var(--ns-C); }
.fc .ns-logo i[data-ns="D"] { --ns: var(--ns-D); } .fc .ns-logo i[data-ns="E"] { --ns: var(--ns-E); }
.fc .ns-logo i.on[data-ns="C"] { color: #3b3200; }
.fc .credit { position: absolute; right: 4px; top: 2px; font-size: 6.5px; color: #fff; text-shadow: 0 0 3px #000; z-index: 1; max-width: 90%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc .sline { background: #efe8da; border-radius: 6px; padding: 4px 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.fc .sline div { text-align: center; }
.fc .sline div + div { border-left: 1px solid #ddd3c0; }
.fc .sline b { display: block; font: 700 12.5px/1.1 "JetBrains Mono"; white-space: nowrap; }
.fc .sline b small { font-size: 8px; font-weight: 500; }
.fc .sline span { display: block; font: 700 7px Inter; text-transform: uppercase; letter-spacing: .05em; color: #8a8478; }
.fc .meta { padding: 4px 10px 6px; font: 600 8px Inter; text-transform: uppercase; letter-spacing: .06em; color: #7b7468; display: flex; justify-content: space-between; gap: 6px; white-space: nowrap; margin-top: auto; }
.fc .meta span { overflow: hidden; text-overflow: ellipsis; }
.fc .meta b { color: var(--r); flex: none; }
.fc .chips { display: flex; flex-wrap: wrap; gap: 3px; }
.fc .chips i { font: 700 7px Inter; font-style: normal; text-transform: uppercase; letter-spacing: .04em; background: #e8f0e1; color: #3f6b2e; border-radius: 4px; padding: 2px 4px; }
/* Rétro : produit qui n'est plus en rayon (indépendant de la Rareté). */
.fc .retro { position: absolute; top: 12px; right: -30px; z-index: 2; transform: rotate(35deg); background: #6b4a2b; color: #f6e7c8; font: 800 7.5px Inter; letter-spacing: .12em; text-transform: uppercase; padding: 3px 32px; box-shadow: 0 1px 4px rgb(0 0 0 / .3); }
.fc.is-retro .in { background: #f4ead6; }
.fc.is-retro .photo img { filter: sepia(.55) contrast(.95); }

/* Photo de packaging telle quelle, sur un fond flou d'elle-même */
.A .top { display: flex; justify-content: space-between; align-items: flex-start; padding: 7px 9px 5px; gap: 6px; min-height: 42px; }
.A .photo { height: 150px; margin: 0 7px; border-radius: 6px; overflow: hidden; position: relative; background: #e9e2d3; flex: none; }
.A .photo .blur { position: absolute; inset: -10px; background-size: cover; background-position: center; filter: blur(12px) brightness(1.05) saturate(1.1); opacity: .65; }
.A .photo img { position: relative; width: 100%; height: 100%; object-fit: contain; display: block; }
.A .sline { margin: 6px 7px 0; }
.A .body { padding: 6px 10px 0; display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.A .brand { font: 800 10px/1.2 Inter; }
.A .brand span { font-weight: 600; color: #7b7468; }
.A .cat { font: italic 9px/1.3 Georgia, serif; color: #5a5246; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
