/* =========================================================================
   shards-shop.css — acheter des Éclats d'Atlas (2026-09-17). Chargé après
   style.css (app/layout.tsx). ui/components/ShardShop.tsx : trois lots côte à
   côte, le plus gros en avant ; dans le Portefeuille sous le bandeau du solde,
   et en fenêtre au Marché quand le solde manque (is-compact).
   1. Cadre et en-tête   2. Les lots   3. Fenêtre du Marché   4. Téléphone
   5. Bouton « ou achetez des éclats » de la mise en vente   6. Mouvement.
   ------------------------------------------------------------------------- */

/* 1. Un cadre chaud, ambre (la monnaie), qui tranche avec le reste du Portefeuille. */
.shard-shop{margin:0 0 22px;padding:22px 24px 18px;border:1px solid color-mix(in srgb,var(--amber) 28%,transparent);border-radius:18px;background:radial-gradient(circle at 100% 0,color-mix(in srgb,var(--amber) 14%,transparent),transparent 55%),var(--surface)}
.shard-shop-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:16px}
.shard-shop-head h2{display:flex;align-items:center;gap:8px;margin:0;font-size:var(--fs-lg);letter-spacing:-.02em}
.shard-shop-head h2 .shard-ic{width:.9em;height:.9em}
.shard-shop-head p{margin:5px 0 0;color:var(--muted);font-size:var(--fs-sm);line-height:1.5;max-width:560px}

/* 2. Lots : montant en grand, prix en dessous, rapport aux 1 000 en petit ;
      le meilleur rapport porte un drapeau et un liseré ambre. */
.shard-shop-lots{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.shard-lot{position:relative;display:grid;gap:4px;justify-items:center;padding:22px 14px 16px;border:1px solid var(--line);border-radius:14px;background:color-mix(in srgb,var(--bg) 60%,transparent);color:var(--text);font:inherit;cursor:pointer;transition:transform 140ms var(--ease-out),border-color 140ms ease,background 140ms ease}
@media (hover:hover) and (pointer:fine){.shard-lot:hover{border-color:color-mix(in srgb,var(--amber) 60%,transparent);background:color-mix(in srgb,var(--amber) 8%,var(--bg))}}   /* le cadre ne bouge pas (retour du propriétaire, 2026-09-26) ; au doigt, pas de survol collé */
.shard-lot:disabled{opacity:.6;cursor:wait;transform:none}
.shard-lot.is-best{border-color:color-mix(in srgb,var(--amber) 70%,transparent);background:color-mix(in srgb,var(--amber) 12%,var(--bg));box-shadow:0 12px 34px color-mix(in srgb,var(--amber) 18%,transparent)}
.shard-lot.is-covering{border-color:color-mix(in srgb,var(--mint) 60%,transparent)}
.shard-lot-flag{position:absolute;top:-10px;left:50%;translate:-50% 0;padding:3px 10px;border-radius:999px;background:var(--amber);color:#1b1406;font-size:var(--fs-xs);font-weight:800;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap}
.shard-lot-flag.is-soft{background:color-mix(in srgb,var(--amber) 22%,var(--surface));color:var(--amber-ink)}
.shard-lot-amount{display:inline-flex;align-items:center;gap:6px;color:var(--amber-ink);font-size:var(--fs-2xl);font-weight:800;letter-spacing:-.03em;line-height:1}
.shard-lot-amount .shard-lot-crystal{width:.8em;height:.8em}
.shard-lot-price{margin-top:4px;padding:6px 16px;border-radius:999px;background:var(--amber);color:#1b1406;font-size:var(--fs-md);font-weight:800}
.shard-lot small{color:var(--dim);font-size:var(--fs-xs);text-align:center;line-height:1.35}
.shard-lot.is-covering small{color:var(--mint)}
.shard-shop-note{margin:14px 0 0;color:var(--dim);font-size:var(--fs-xs);line-height:1.45}

/* 2 bis. Dans le Portefeuille sur grand écran (2026-09-17, retour du
   propriétaire : trop gros) : une bande discrète, titre à gauche, les trois
   lots à droite en petites tuiles sur une ligne, montant et prix côte à côte.
   La fenêtre du Marché (is-compact) garde les grandes tuiles : on y vient
   pour acheter. Téléphone : §4 reprend la main. */
@media(min-width:641px){
  .shard-shop:not(.is-compact){display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:18px;padding:16px 20px}
  .shard-shop:not(.is-compact) .shard-shop-head{margin:0}
  .shard-shop:not(.is-compact) .shard-shop-head h2{font-size:var(--fs-md)}
  .shard-shop:not(.is-compact) .shard-shop-head p{margin-top:3px;font-size:var(--fs-xs);max-width:380px}
  .shard-shop:not(.is-compact) .shard-shop-note{display:none}
  .shard-shop:not(.is-compact):not(.is-bare) .secure-pay{grid-column:2;justify-content:center;margin-top:-10px}   /* sous les lots, là où on clique ; pas en Paramètres (is-bare, en bloc : la ligne remontait sur les tuiles) */
  .shard-shop:not(.is-compact) .shard-shop-lots{display:flex;gap:8px}
  .shard-shop:not(.is-compact) .shard-lot{grid-template-columns:auto auto;grid-template-areas:"amount price" "note note";justify-items:start;align-items:center;gap:3px 12px;padding:18px 16px 10px;border-radius:12px}   /* 18 px en haut : l'étiquette (-17 %, Meilleur rapport) ne touche plus le prix ; les trois tuiles gardent la même ligne */
  .shard-shop:not(.is-compact) .shard-lot-amount{grid-area:amount;font-size:var(--fs-lg)}
  .shard-shop:not(.is-compact) .shard-lot-price{grid-area:price;margin:0;padding:4px 11px;font-size:var(--fs-sm)}
  .shard-shop:not(.is-compact) .shard-lot small{grid-area:note;text-align:left;font-size:var(--fs-xs)}
  .shard-shop:not(.is-compact) .shard-lot-flag{top:-9px;left:12px;translate:0;padding:1px 8px;font-size:var(--fs-xs);line-height:1.4;letter-spacing:.04em}
  .shard-shop:not(.is-compact) .shard-lot.is-best{box-shadow:none}
}

/* 2 ter. Paramètres (is-bare) : les tuiles seules dans la ligne « Éclats
   d'Atlas », mêmes tuiles que la bande du Portefeuille, sans cadre. */
.shard-shop.is-bare{margin:0;padding:0;border:0;background:none;display:block;width:100%;flex:1 1 100%}
/* settings.css empile tout <span> d'une ligne en colonne (.settings-row span) : les tuiles reprennent leurs rangs. */
.settings-row .shard-lot span{flex-direction:row}
.settings-row .shard-lot .shard-lot-amount{display:inline-flex;align-items:center;gap:6px}
.settings-row .shard-lot .shard-lot-price{display:inline-flex;align-items:center;justify-content:center}
.settings-row .shard-lot .shard-lot-flag{display:inline-block}
@media(min-width:641px){.shard-shop.is-bare .shard-shop-lots{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.shard-shop.is-bare .shard-lot{width:100%;grid-template-columns:1fr auto}}

/* 3. Fenêtre du Marché : même cadre, sans marge, un peu plus serré. */
.shard-shop .secure-pay{margin-top:12px}   /* sous les lots, avant la note (premium.css §8) */
.modal .shard-shop{margin:0;border:0;background:radial-gradient(circle at 100% 0,color-mix(in srgb,var(--amber) 14%,transparent),transparent 55%)}
.shard-shop.is-compact{padding:8px 4px 4px}
.shard-shop.is-compact .shard-shop-head h2{font-size:var(--fs-xl)}

/* 4. Téléphone : les lots empilés, le montant et le prix sur une ligne. */
@media(max-width:640px){
  .shard-shop{padding:18px 16px 14px}
  .shard-shop-lots{grid-template-columns:1fr;gap:10px}
  .shard-lot{grid-template-columns:1fr auto;grid-template-areas:"amount price" "note note";justify-items:start;padding:16px 14px 12px}
  .shard-lot-amount{grid-area:amount;font-size:var(--fs-xl)}
  .shard-lot-price{grid-area:price;margin:0}
  .shard-lot small{grid-area:note;text-align:left}
  .shard-lot-flag{left:14px;translate:0}
}

/* 5. Mise en vente : quand les frais dépassent le solde, le lien vers les éclats suit l'explication. */
.sell-fee-buy{border:0;background:none;color:var(--amber-ink);font:inherit;font-size:var(--fs-xs);font-weight:800;text-decoration:underline;cursor:pointer;padding:0;justify-self:start}

/* 6. Mouvement (maquette validée : public/mockups/eclats-animes.html, 2026-09-26).
      Survol : une lumière douce suit la souris (--mx/--my posés par ShardShop.tsx),
      le contour s'éclaire du même côté, une facette du cristal scintille et une
      étoile brille à sa pointe. Le cadre ne bouge pas. Appui : la tuile s'enfonce. Meilleur rapport : un fin trait de lumière
      fait le tour du contour ; il s'éteint en fondu quand la souris est sur une autre
      tuile, et se rallume doucement quand elle n'en survole plus aucune. Achat : coche dans le prix, éclats en vol vers le
      solde (ui/shard-celebration.ts). Arrivée : les tuiles montent du flou, une
      fois (motion.css §9). Mouvement réduit : fondus seulement. */
.shard-lot{transition:transform 160ms var(--ease-out),border-color 200ms ease,background-color 200ms ease}
.shard-lot.is-best{transition:transform 160ms var(--ease-out),border-color 900ms ease 250ms,background-color 900ms ease 250ms}   /* se rallume sans hâte (voir plus bas) */
.shard-lot:active:not(:disabled){transform:scale(.97);transition-duration:100ms}
.shard-lot>:is(.shard-lot-amount,.shard-lot-price,small){position:relative;z-index:1}   /* devant la lumière, sinon elle voile le chiffre */
.shard-lot-glow,.shard-lot-edge,.shard-lot-beam{position:absolute;inset:0;border-radius:inherit;pointer-events:none}
.shard-lot-glow,.shard-lot-edge{opacity:0;transition:opacity 220ms ease}
.shard-lot-glow{background:radial-gradient(180px circle at var(--mx,50%) var(--my,50%),color-mix(in srgb,#fde68a 13%,transparent),transparent 65%)}
.shard-lot-edge,.shard-lot-beam{inset:-1px;padding:1px;-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0)}
.shard-lot-edge{background:radial-gradient(120px circle at var(--mx,50%) var(--my,50%),#fcd34d,transparent 70%)}
/* Le cristal de la tuile : l'éclat, et par-dessus la facette claire et l'étoile, éteintes au repos. */
.shard-lot-crystal{position:relative;display:inline-flex;flex:none;transition:transform 220ms var(--ease-out)}
.shard-lot-crystal .shard-ic{width:100%;height:100%}
.shard-lot-facet{position:absolute;inset:0;width:100%;height:100%;fill:#fff;opacity:0}
.shard-lot-star{position:absolute;left:36%;top:-.3em;width:.5em;height:.5em;fill:#fffbeb;opacity:0;transform:scale(.4);pointer-events:none}
/* Le prix : une coche après l'achat, à la place du montant. */
.shard-lot-price{position:relative;display:inline-flex;align-items:center;justify-content:center}
.shard-lot-ok{position:absolute;inset:0;display:grid;place-items:center;opacity:0;filter:blur(3px);transition:opacity 200ms ease,filter 200ms ease}
.shard-lot-eur{transition:opacity 200ms ease,filter 200ms ease}
.shard-lot.is-done .shard-lot-ok{opacity:1;filter:none}
.shard-lot.is-done .shard-lot-eur{opacity:0;filter:blur(3px)}
@media (hover:hover) and (pointer:fine){
  .shard-lot:hover:not(:disabled) :is(.shard-lot-glow,.shard-lot-edge){opacity:1}
  .shard-lot:hover:not(:disabled) .shard-lot-crystal{transform:translateY(-1px)}
  .shard-lot:hover:not(:disabled) .shard-lot-facet{animation:lot-facet 700ms var(--ease-out)}
  .shard-lot:hover:not(:disabled) .shard-lot-star{animation:lot-star 700ms var(--ease-out) 80ms}
}
@keyframes lot-facet{30%{opacity:.85}to{opacity:0}}
@keyframes lot-star{35%{opacity:1;transform:scale(1) rotate(45deg)}to{opacity:0;transform:scale(.5) rotate(90deg)}}
/* Meilleur rapport : un fin trait de lumière fait le tour du contour, 7 s par tour, arrêté hors de l'écran. */
@property --lot-beam{syntax:"<angle>";inherits:false;initial-value:0deg}
.shard-lot-beam{background:conic-gradient(from var(--lot-beam),transparent 0 70%,color-mix(in srgb,#fde68a 90%,transparent) 84%,transparent 94%);animation:lot-beam 7s linear infinite;transition:opacity 900ms ease 250ms}
/* Une autre tuile survolée : le trait et le liseré ambré du meilleur rapport s'éteignent vite (250 ms), pour laisser la
   lumière à celle qu'on regarde ; la souris partie, ils se rallument sans hâte (un temps, puis 900 ms). */
@media (hover:hover) and (pointer:fine){
  .shard-shop-lots:has(.shard-lot:not(.is-best):hover) .shard-lot-beam{opacity:0;transition:opacity 250ms ease}
  .shard-shop-lots:has(.shard-lot:not(.is-best):hover) .shard-lot.is-best{border-color:var(--line);background:color-mix(in srgb,var(--bg) 60%,transparent);transition:transform 160ms var(--ease-out),border-color 250ms ease,background-color 250ms ease}
}
.shard-shop.is-offscreen .shard-lot-beam{animation-play-state:paused}
@keyframes lot-beam{to{--lot-beam:360deg}}
/* Arrivée : les tuiles montent en sortant d'un léger flou, l'une après l'autre. */
.shard-lot{animation:lot-in 280ms var(--ease-out) backwards}
.shard-lot:nth-child(2){animation-delay:60ms}.shard-lot:nth-child(3){animation-delay:120ms}
@keyframes lot-in{from{opacity:0;translate:0 10px;filter:blur(4px)}}
/* Éclats en vol vers le solde, après un achat (ui/shard-celebration.ts, WAAPI). */
.shard-fly{position:fixed;left:0;top:0;z-index:90;width:16px;height:16px;pointer-events:none;will-change:transform,opacity}
.shard-fly .shard-ic{width:100%;height:100%}
@media (prefers-reduced-motion:reduce){
  .shard-lot{animation:fade-in 200ms ease backwards}
  .shard-lot:active:not(:disabled){transform:none}
  .shard-lot-beam,.shard-lot-facet,.shard-lot-star{animation:none!important}
}
