:root {
  --bg: #0f0a1f;
  --bg-2: #160f2c;
  --panel: #1c1438;
  --line: #342a5e;
  --text: #f0ebff;
  --muted: #a99fcf;
  --gold: #b57bff;       /* accent principal (violet) */
  --gold-2: #d9b8ff;     /* accent clair */
  --red: #ff5c8a;
  --radius: 18px;
  --on-gold: #140d26;
  /* reflet holographique, gardé dans les violets */
  --holo: linear-gradient(100deg, #8f6bff 0%, #c77dff 30%, #ff7ac8 55%, #b98cff 78%, #7fa6ff 100%);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 Manrope, system-ui, sans-serif;
  background-image: radial-gradient(ellipse at 8% 0%, #3b1f6e 0%, transparent 50%), radial-gradient(ellipse at 95% 15%, #2a1d63 0%, transparent 45%);
  background-attachment: fixed;
}
a { color: var(--gold-2); }
h1, h2, .brand { font-family: Unbounded, system-ui, sans-serif; letter-spacing: -.02em; }

.top {
  position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center;
  padding: 12px clamp(16px, 4vw, 48px); background: rgba(15, 13, 11, .85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { color: var(--text); text-decoration: none; font-size: 1.15rem; font-weight: 700; }
.sigil { color: var(--gold); }
.cart-btn {
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; font: inherit; cursor: pointer;
}
#cartCount { background: var(--gold); color: var(--on-gold); border-radius: 999px; padding: 0 8px; margin-left: 6px; font-weight: 600; }

.hero {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center;
  padding: clamp(32px, 7vw, 90px) clamp(16px, 4vw, 48px); max-width: 1280px; margin: 0 auto;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1.05; margin: 0 0 16px; color: var(--gold-2); }
.hero p { color: var(--muted); max-width: 46ch; font-size: 1.05rem; }
.hero-stats { color: var(--text) !important; font-weight: 500; }
.hero-fan { position: relative; height: 380px; }
.hero-fan img {
  position: absolute; left: 50%; top: 20px; width: 190px; border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .6); transform-origin: 50% 120%; transition: transform .4s;
}
.hero-fan:hover img { transform: var(--t) translateY(-8px); }

.btn {
  display: inline-block; background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--on-gold);
  border: 0; border-radius: 8px; padding: 12px 22px; font: 600 1rem Manrope, sans-serif; text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: wait; }
.btn.wide { width: 100%; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; text-decoration: underline; }
.notice { max-width: 1280px; margin: 0 auto 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }

main { max-width: 1280px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) 60px; }
.filters {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px; margin-bottom: 8px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  position: sticky; top: 58px; z-index: 10;
}
.filters input[type=search], .filters select {
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 10px; font: inherit; min-width: 0;
}
.filters input[type=search] { flex: 1 1 220px; }
.filters select { max-width: 100%; }
.colors { display: flex; gap: 4px; }
.pip input { display: none; }
.pip span {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  font-size: .75rem; font-weight: 700; border: 2px solid transparent; color: var(--on-gold);
}
.pip input:checked + span { border-color: var(--gold-2); box-shadow: 0 0 0 2px var(--bg-2), 0 0 12px var(--gold); }
.pip-W span { background: #f4efd8; } .pip-U span { background: #6fa6d6; } .pip-B span { background: #9c8e9b; }
.pip-R span { background: #e07a5f; } .pip-G span { background: #6fb07f; }
.pip-M span { background: conic-gradient(#f4efd8, #6fa6d6, #9c8e9b, #e07a5f, #6fb07f, #f4efd8); }
.pip-C span { background: #c9c2b8; } .pip-L span { background: #b89a6a; }
.result-count { color: var(--muted); margin: 14px 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card .img { position: relative; aspect-ratio: 488 / 680; background: #0a0907; cursor: zoom-in; }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .img.foil::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; opacity: .55;
  background: linear-gradient(115deg, transparent 0%, transparent 30%, rgba(255,122,217,.8) 42%, rgba(122,240,255,.8) 50%, rgba(255,242,122,.8) 58%, transparent 70%, transparent 100%);
  background-size: 300% 100%; animation: shine 7s linear infinite;
}
@keyframes shine { from { background-position: 150% 0; } to { background-position: -150% 0; } }
.badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; }
.badge { background: rgba(0, 0, 0, .75); color: #fff; font-size: .7rem; font-weight: 600; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; }
.badge.foil { background: linear-gradient(90deg, #b35ce0, #3fb6d9); }
.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card h3 { font-size: .95rem; margin: 0; line-height: 1.25; }
.card .meta { color: var(--muted); font-size: .78rem; }
.card .buy { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding-top: 6px; }
.price { font-weight: 700; color: var(--gold-2); font-size: 1.1rem; }
.add {
  background: transparent; color: var(--gold-2); border: 1px solid var(--gold); border-radius: 6px;
  padding: 5px 10px; font: 600 .85rem Manrope, sans-serif; cursor: pointer;
}
.add:hover { background: var(--gold); color: var(--on-gold); }
.add:disabled { opacity: .4; cursor: default; background: none; color: var(--muted); border-color: var(--line); }
.stock { font-size: .72rem; color: var(--muted); }
.empty { color: var(--muted); padding: 40px 0; text-align: center; grid-column: 1 / -1; }

.pager { display: flex; gap: 6px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
.pager button { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; cursor: pointer; font: inherit; }
.pager button.on { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }

.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; }
.overlay.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--bg-2);
  border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .25s; z-index: 40;
  display: flex; flex-direction: column;
}
.drawer.on { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 1.2rem; }
.x { background: none; border: 0; color: var(--muted); font-size: 1.8rem; cursor: pointer; line-height: 1; }
.cart-items { flex: 1; overflow: auto; padding: 12px 20px; }
.line { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line img { width: 48px; border-radius: 4px; }
.line .n { font-size: .88rem; }
.line .m { font-size: .75rem; color: var(--muted); }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 24px; height: 24px; border-radius: 4px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; }
.drawer-foot { padding: 16px 20px; border-top: 1px solid var(--line); }
.total { display: flex; justify-content: space-between; font-size: 1.1rem; margin-bottom: 8px; }
.small { font-size: .8rem; } .muted { color: var(--muted); }

dialog#zoom { background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 16px; max-width: min(92vw, 420px); }
dialog#zoom::backdrop { background: rgba(0, 0, 0, .75); }
dialog#zoom img { width: 100%; border-radius: 12px; display: block; }
dialog#zoom .x { position: absolute; top: 4px; right: 10px; }
.zoom-info { padding-top: 10px; font-size: .9rem; }

.foot { border-top: 1px solid var(--line); padding: 24px clamp(16px, 4vw, 48px); color: var(--muted); font-size: .8rem; text-align: center; }
.page { max-width: 760px; margin: 40px auto; padding: 0 20px; }
.page h1 { color: var(--gold-2); }

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; }
  .hero-fan { height: 260px; }
  .hero-fan img { width: 140px; }
  .filters { position: static; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
}

/* ---------- Habillage violet holographique ---------- */
.hero h1 { background: var(--holo); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
.sigil { background: var(--holo); -webkit-background-clip: text; background-clip: text; color: transparent; }
.top { background: rgba(15, 10, 31, .72); }
.btn { background: var(--holo); border-radius: 999px; }
.card { border-radius: 18px; border: 1px solid transparent;
  background: linear-gradient(var(--panel), var(--panel)) padding-box, linear-gradient(160deg, #43357a, var(--panel) 60%) border-box; }
.card:hover { background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--holo) border-box; }
.price { background: var(--holo); -webkit-background-clip: text; background-clip: text; color: transparent; }
.add { border-radius: 999px; border-color: var(--line); color: var(--text); }
.add:hover { background: var(--holo); color: var(--on-gold); border-color: transparent; }
.filters { border-radius: 22px; background: rgba(28, 20, 56, .78); backdrop-filter: blur(10px); }
.filters input[type=search], .filters select, .cart-btn { border-radius: 999px; }
#cartCount, .pager button.on { background: var(--holo); }
.badge.foil { background: var(--holo); color: var(--on-gold); }
.hero-fan img { border-radius: 14px; box-shadow: 0 20px 50px rgba(110, 60, 210, .5); }
.langs { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-right: 10px; }
.langs button { background: none; border: 0; color: var(--muted); font: 700 .8rem Manrope, sans-serif; padding: 5px 10px; border-radius: 999px; cursor: pointer; }
.langs button.on { background: var(--holo); color: var(--on-gold); }
.top-right { display: flex; align-items: center; }
.card .alt { font-size: .74rem; color: var(--muted); font-style: italic; }

/* ---------- Offres ---------- */
.offer-page { max-width: 980px; margin: 0 auto; padding: 36px clamp(16px, 4vw, 48px) 80px; }
.offer-page h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 6px 0 20px; background: var(--holo); -webkit-background-clip: text; background-clip: text; color: transparent; }
.offer-status { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.offer-status .btn { margin-left: auto; }
.status-refused, .status-expired, .status-cancelled { opacity: .7; }
.offer-sums { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 16px 0 24px; }
.offer-sums div { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.offer-sums span { display: block; color: var(--muted); font-size: .8rem; }
.offer-sums b { font-size: 1.4rem; }
.offer-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.offer-item { display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: center; background: var(--panel); border-radius: 12px; padding: 8px; }
.offer-item img { width: 54px; border-radius: 4px; }
.offer-item span { display: block; font-size: .8rem; color: var(--muted); }
dialog.offer { background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 20px; padding: 24px; width: min(520px, 94vw); }
dialog.offer::backdrop { background: rgba(8, 5, 18, .75); }
dialog.offer h2 { margin: 0 0 6px; font-size: 1.3rem; }
dialog.offer label { display: block; margin: 12px 0 4px; font-size: .85rem; color: var(--muted); }
dialog.offer input, dialog.offer textarea { width: 100%; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; }
dialog.offer textarea { min-height: 80px; resize: vertical; }
dialog.offer .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
dialog.offer .hp { position: absolute; left: -9999px; }
dialog.offer .actions { display: flex; gap: 12px; align-items: center; margin-top: 18px; }
dialog.offer .pct { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.how { max-width: 1280px; margin: 0 auto 30px; padding: 0 clamp(16px, 4vw, 48px); display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.how div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.how b { display: block; margin-bottom: 4px; background: var(--holo); -webkit-background-clip: text; background-clip: text; color: transparent; font-family: Unbounded, sans-serif; }
.how span { color: var(--muted); font-size: .9rem; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Chat ---------- */
dialog#zoom #zoomAsk { width: 100%; margin-top: 12px; }
.chat-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 45; display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border: 0; border-radius: 999px; background: var(--holo); color: var(--on-gold);
  font: 700 .95rem Manrope, sans-serif; cursor: pointer; box-shadow: 0 10px 30px rgba(120, 60, 220, .45);
}
.chat-badge { background: var(--on-gold); color: #fff; border-radius: 999px; min-width: 20px; padding: 0 6px; font-size: .75rem; line-height: 20px; text-align: center; }
body.chat-open .chat-fab { display: none; }
.chat {
  position: fixed; right: 20px; bottom: 20px; z-index: 50; width: min(380px, calc(100vw - 32px)); height: min(600px, calc(100vh - 40px));
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(16px) scale(.98); pointer-events: none; transition: opacity .18s, transform .18s;
}
.chat.on { opacity: 1; transform: none; pointer-events: auto; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.chat-head strong { display: block; font-family: Unbounded, sans-serif; font-size: .95rem; }
.chat-head span { color: var(--muted); font-size: .8rem; }
.chat-thread { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.chat .msg { display: flex; }
.chat .msg .bubble { max-width: 82%; padding: 9px 12px; border-radius: 16px; font-size: .9rem; overflow-wrap: anywhere; }
.chat .msg.seller .bubble { background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat .msg.buyer { justify-content: flex-end; }
.chat .msg.buyer .bubble { background: var(--holo); color: var(--on-gold); border-bottom-right-radius: 4px; }
.chat .msg.buyer a { color: var(--on-gold); }
.chat .msg.system { justify-content: center; }
.chat .msg.system .bubble { max-width: 95%; background: transparent; border: 1px dashed var(--line); color: var(--muted); font-size: .8rem; text-align: center; }
.chat .msg time { display: block; font-size: .7rem; opacity: .6; text-align: right; margin-top: 2px; }
.chat .day { align-self: center; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; margin: 6px 0 2px; }
.chat-ref { display: flex; gap: 8px; align-items: center; background: rgba(0, 0, 0, .18); border-radius: 10px; padding: 6px; margin-bottom: 6px; }
.chat-ref img { width: 36px; border-radius: 3px; }
.chat-ref b { display: block; font-size: .85rem; line-height: 1.2; }
.chat-ref span { font-size: .75rem; opacity: .8; }
.chat-form { border-top: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.chat-who { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chat-who[hidden] { display: none; }
.chat-who .hp { position: absolute; left: -9999px; width: 1px; }
.chat-form input, .chat-form textarea {
  width: 100%; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; font: inherit; font-size: .9rem;
}
.chat-form textarea { resize: none; max-height: 140px; line-height: 1.4; }
.chat-send { display: flex; gap: 8px; align-items: flex-end; }
.chat-send .btn { padding: 10px 12px; flex: none; display: flex; }
.chat-card { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); }
.chat-card[hidden] { display: none; }
.chat-card .chat-ref { flex: 1; margin: 0; color: var(--text); }
.chat-card .x { font-size: 1.3rem; }
@media (max-width: 600px) {
  .chat:not(.page-mode) { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .chat-fab { right: 16px; bottom: 16px; }
}

/* Page discussion.php */
.discussion .top { gap: 12px; }
.small-btn { padding: 8px 14px; font-size: .85rem; }
.discussion-page { max-width: 760px; margin: 24px auto 40px; padding: 0 16px; display: flex; flex-direction: column; gap: 16px; }
.chat.page-mode { position: static; width: 100%; height: min(70vh, 680px); opacity: 1; transform: none; pointer-events: auto; box-shadow: none; }
.my-offers { display: flex; flex-direction: column; gap: 8px; }
.my-offers h2 { margin: 0; font-size: 1rem; font-family: Unbounded, sans-serif; }
.my-offer { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; color: var(--text); text-decoration: none; }
.my-offer span { color: var(--muted); }
.my-offer em { margin-left: auto; font-style: normal; font-size: .8rem; border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; }
.my-offer.status-accepted em, .my-offer.status-listed em { border-color: var(--gold); color: var(--gold-2); }
.my-offer.status-refused, .my-offer.status-expired, .my-offer.status-cancelled { opacity: .55; }
.chat-who input, .chat-send textarea { min-width: 0; }
.chat-send textarea { flex: 1; }
