/* TCG Radar : système visuel
   Tiré du logo (Ramoloss radar) : nuit #0e0f24, violet, rose Ramoloss, crème du museau.
   Le violet est la couleur d'action (boutons, onglet actif, liens) ; le dégradé « radar »
   violet → rose → crème est réservé à la marque et à la hype. Vert, rouge, bleu et ambre
   gardent leur sens (acheter, vendre, conserver, attendre). */
:root {
  --bg: #f6f4fb;
  --bg-2: #efebf8;
  --surface: #ffffff;
  --surface-2: #f8f6fc;
  --surface-3: #eee9f7;
  --ink: #14122b;
  --ink-2: #403a63;
  --ink-3: #6f6791;
  --line: #e6e1f1;
  --line-strong: #d3cbe5;
  --accent: #6a3bc4;
  --accent-ink: #ffffff;
  --accent-soft: #efe7fd;
  --brand-night: #0f1029;
  --brand-pink: #c86cc4;
  --brand-cream: #f1d2a0;
  --up: #0f8d55;
  --up-soft: #e3f5ec;
  --down: #c94a45;
  --down-soft: #fbecea;
  --hold: #2f6fd8;
  --hold-soft: #e6effd;
  --wait: #a86a06;
  --wait-soft: #fbf1df;
  --gold: #e9a218;
  --chart: #6a3bc4;
  --chart-fill: rgba(106, 59, 196, .10);
  --holo: linear-gradient(120deg, #4b2a86, #8c55d6 35%, #d27fd0 68%, #f1d2a0);
  --shadow-1: 0 1px 2px rgba(20, 18, 43, .04), 0 2px 8px rgba(20, 18, 43, .05);
  --shadow-2: 0 2px 6px rgba(20, 18, 43, .05), 0 14px 32px rgba(20, 18, 43, .09);
  --f-display: "Bricolage Grotesque", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Onest", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --r-s: 10px;
  --r: 16px;
  --r-l: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1029; --bg-2: #131430; --surface: #16172f; --surface-2: #1b1c38; --surface-3: #242447;
    --ink: #f1eefb; --ink-2: #cbc4e3; --ink-3: #948cb5; --line: #26264a; --line-strong: #34335e;
    --accent: #b98cff; --accent-ink: #120d24; --accent-soft: #2a1f4f; --brand-pink: #e08fdc; --brand-cream: #f1d2a0;
    --up: #45d08f; --up-soft: rgba(69, 208, 143, .12); --down: #ff8a80; --down-soft: rgba(255, 138, 128, .12);
    --hold: #7eaaff; --hold-soft: rgba(126, 170, 255, .12); --wait: #f2bd5c; --wait-soft: rgba(242, 189, 92, .12);
    --gold: #f2bd5c; --chart: #b98cff; --chart-fill: rgba(185, 140, 255, .14);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .35); --shadow-2: 0 4px 10px rgba(0, 0, 0, .35), 0 18px 40px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
/* Page de connexion : toujours en mode nuit, comme le logo */
body.night {
    --bg: #0f1029; --bg-2: #131430; --surface: #16172f; --surface-2: #1b1c38; --surface-3: #242447;
    --ink: #f1eefb; --ink-2: #cbc4e3; --ink-3: #948cb5; --line: #26264a; --line-strong: #34335e;
    --accent: #b98cff; --accent-ink: #120d24; --accent-soft: #2a1f4f; --brand-pink: #e08fdc; --brand-cream: #f1d2a0;
    --up: #45d08f; --up-soft: rgba(69, 208, 143, .12); --down: #ff8a80; --down-soft: rgba(255, 138, 128, .12);
    --hold: #7eaaff; --hold-soft: rgba(126, 170, 255, .12); --wait: #f2bd5c; --wait-soft: rgba(242, 189, 92, .12);
    --gold: #f2bd5c; --chart: #b98cff; --chart-fill: rgba(185, 140, 255, .14);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .35); --shadow-2: 0 4px 10px rgba(0, 0, 0, .35), 0 18px 40px rgba(0, 0, 0, .35);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.6 var(--f-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: 420px; z-index: -1; pointer-events: none;
  background: radial-gradient(1200px 380px at 20% -120px, var(--accent-soft), transparent 70%); }
h1, h2, h3 { font-family: var(--f-display); letter-spacing: -.02em; text-wrap: balance; margin: 0; color: var(--ink); }
h1 { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.3rem); font-weight: 700; line-height: 1.15; }
h2 { font-size: 1.3rem; font-weight: 650; line-height: 1.25; }
h3 { font-size: 1.05rem; font-weight: 600; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, td.num, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }

/* ---------- En-tête ---------- */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.top-in, .tabs, .wrap, .status-in { max-width: 1240px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px 8px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 40px; height: 40px; border-radius: 50%; flex: none; display: block; background: var(--brand-night);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px color-mix(in srgb, var(--accent) 55%, transparent); animation: radar 3.6s var(--ease) infinite; }
@keyframes radar { 0%, 55% { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px color-mix(in srgb, var(--accent) 55%, transparent); }
  80% { box-shadow: 0 0 0 2px var(--surface), 0 0 0 11px color-mix(in srgb, var(--accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px color-mix(in srgb, var(--accent) 55%, transparent); } }
@keyframes holo { 50% { background-position: 100% 50%; } }
.brand-name { font-family: var(--f-display); font-weight: 800; font-size: 1.32rem; letter-spacing: .01em; text-transform: uppercase; line-height: 1; }
.brand-name b { font-weight: 800; color: var(--accent); }
.login-hero { display: grid; justify-items: center; gap: 10px; text-align: center; }
.login-hero img { width: min(236px, 58vw); height: auto; display: block; }
.login-hero p { margin: 0; color: var(--ink-3); font-size: .95rem; }
body.night::before { inset: auto 0 0; height: 60vh; background: radial-gradient(700px 360px at 50% 100%, color-mix(in srgb, #7b45c8 26%, transparent), transparent 70%); }
.brand-sub { color: var(--ink-3); font-size: .9rem; }
.game-switch { display: inline-flex; background: var(--surface-3); border-radius: 999px; padding: 4px; gap: 2px; }
.game-switch button { border: 0; background: none; padding: 8px 18px; border-radius: 999px; cursor: pointer; color: var(--ink-2); font-weight: 600; transition: background .25s var(--ease), color .25s var(--ease), box-shadow .25s; }
.game-switch button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-block: 4px 12px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 8px 14px; color: var(--ink-2); text-decoration: none; white-space: nowrap; border-radius: 999px; font-weight: 550; font-size: .95rem; transition: background .2s, color .2s; }
.tabs a:hover { background: var(--surface-3); color: var(--ink); }
.tabs a.on { background: var(--accent); color: var(--accent-ink); }

/* ---------- Statut ---------- */
.status { font-size: .85rem; color: var(--ink-3); }
.status-in { display: flex; gap: 8px 18px; flex-wrap: wrap; align-items: center; padding-block: 12px 0; }
.status .live { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 550; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 4px var(--up-soft); }
.status .dot.busy { background: var(--wait); box-shadow: 0 0 0 4px var(--wait-soft); animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .35; } }
.status button { margin-left: auto; }

/* ---------- Mise en page ---------- */
.wrap { padding-block: 28px 96px; display: flex; flex-direction: column; gap: 32px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-head p { margin: 8px 0 0; color: var(--ink-2); max-width: 68ch; font-size: 1.02rem; }
section { display: flex; flex-direction: column; gap: 14px; }
.group-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.group-title p { margin: 4px 0 0; color: var(--ink-3); font-size: .95rem; }
.muted { color: var(--ink-3); }
.small { font-size: .88rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 20px; }

/* ---------- Contrôles ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
input[type=search], input[type=text], input[type=number], input[type=date], input[type=password], select, textarea {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 14px; min-width: 0; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input[type=search] { min-width: min(360px, 100%); flex: 1 1 280px; padding-left: 40px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%236a7290' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") no-repeat 14px center; }
.btn { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 12px; padding: 9px 16px; cursor: pointer; font-weight: 600; white-space: nowrap; color: var(--ink);
  transition: transform .15s var(--ease), box-shadow .2s, border-color .2s, background .2s; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--ink-3); box-shadow: var(--shadow-1); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.ghost { background: none; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-3); box-shadow: none; }
.btn.small { padding: 6px 12px; font-size: .86rem; border-radius: 10px; }
.btn.danger { color: var(--down); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 7px 14px; cursor: pointer; font-size: .9rem; color: var(--ink-2); font-weight: 550; transition: all .2s var(--ease); }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- Surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-1); }
.panel-pad { padding: 22px 24px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow-1); }
.kpi .lab { font-size: .84rem; color: var(--ink-3); font-weight: 550; }
.kpi .val { font-family: var(--f-mono); font-size: 1.6rem; font-weight: 500; margin-top: 4px; letter-spacing: -.02em; line-height: 1.2; }
.kpi .sub { font-size: .84rem; color: var(--ink-2); margin-top: 2px; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.price-grid .kpi .val { font-size: 1.3rem; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-1); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: .82rem; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; transition: background .15s; }
tr.click:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; white-space: nowrap; }
.pname { font-weight: 600; line-height: 1.35; }
.psub { color: var(--ink-3); font-size: .88rem; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-top: 5px; }
.thumb { width: 40px; height: 56px; object-fit: cover; border-radius: 4px; background: var(--surface-3); display: block; }

/* ---------- Pastilles ---------- */
.sig { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.sig::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sig.up { background: var(--up-soft); color: var(--up); }
.sig.down { background: var(--down-soft); color: var(--down); }
.sig.hold { background: var(--hold-soft); color: var(--hold); }
.sig.wait { background: var(--wait-soft); color: var(--wait); }
.sig.neutral { background: var(--surface-3); color: var(--ink-2); }
.pos { color: var(--up); } .neg { color: var(--down); }
.tag { display: inline-flex; align-items: center; font-size: .8rem; padding: 2px 9px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; font-weight: 500; }
.tag.warn { background: var(--wait-soft); color: var(--wait); }
.tag.alert { background: var(--wait-soft); color: var(--wait); }
.tag.vf { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.grade { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; font-family: var(--f-display); font-weight: 800; font-size: .95rem; }
.grade.A { background: var(--up); color: #fff; } .grade.B { background: var(--up-soft); color: var(--up); }
.grade.C { background: var(--hold-soft); color: var(--hold); } .grade.D { background: var(--wait-soft); color: var(--wait); } .grade.E { background: var(--down-soft); color: var(--down); }

/* ---------- Bandeaux d'information (doux, jamais criards) ---------- */
.note { border-radius: var(--r); padding: 14px 18px 14px 46px; background: var(--surface-2); color: var(--ink-2); font-size: .94rem; position: relative; border: 1px solid var(--line); }
.note::before { content: "i"; position: absolute; left: 16px; top: 14px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 700 .75rem/1 var(--f-display); background: var(--ink-3); color: var(--surface); }
.note.warn, .note.alert { background: var(--wait-soft); border-color: transparent; color: var(--ink); }
.note.warn::before, .note.alert::before { content: "!"; background: var(--wait); }
.note.ok { background: var(--up-soft); border-color: transparent; color: var(--ink); }
.note.ok::before { content: "✓"; background: var(--up); }
.note ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Grille de cartes ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 18px; }
.ccard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; text-align: left; box-shadow: var(--shadow-1); transition: transform .25s var(--ease), box-shadow .25s; }
.ccard:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.ccard img { width: 100%; aspect-ratio: 63/88; object-fit: cover; border-radius: 10px; background: var(--surface-3); max-width: 100%; }
.ccard .nm { font-weight: 650; line-height: 1.3; }
.ccard .meta { font-size: .8rem; color: var(--ink-3); min-height: 2.4em; }
.ccard .px { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.ccard .px b { font-family: var(--f-mono); font-weight: 500; font-size: 1.1rem; }

/* ---------- Panneau de détail ---------- */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer-back { position: absolute; inset: 0; background: rgba(9, 13, 24, .38); backdrop-filter: blur(3px); animation: fade .25s var(--ease); }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(800px, 100%); background: var(--bg); overflow-y: auto;
  padding: 28px max(20px, env(safe-area-inset-right, 0px)) 64px 28px; box-shadow: var(--shadow-2); display: flex; flex-direction: column; gap: 22px;
  animation: slideIn .38s var(--ease); border-radius: var(--r-l) 0 0 var(--r-l); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.drawer-x { position: sticky; top: 0; align-self: flex-end; border: 1px solid var(--line); background: var(--surface); border-radius: 50%; width: 40px; height: 40px; font-size: 1.4rem; cursor: pointer; box-shadow: var(--shadow-1); margin-bottom: -40px; z-index: 2; transition: transform .2s; }
.drawer-x:hover { transform: rotate(90deg); }
.d-head { display: flex; gap: 20px; align-items: flex-start; padding-right: 52px; }
.d-head > img { width: 220px; max-width: 100%; height: auto; aspect-ratio: 63 / 88; object-fit: contain; border-radius: 14px; flex: none; box-shadow: var(--shadow-2); background: var(--surface-3); }
.d-head > div { min-width: 0; }
.reasons { margin: 8px 0 0; padding-left: 20px; color: var(--ink-2); font-size: .95rem; display: grid; gap: 4px; }
.fc-table td, .fc-table th { padding: 10px 14px; }
.links { display: flex; flex-wrap: wrap; gap: 10px; }
form.inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; align-items: end; }
form.inline label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--ink-3); }
.chart svg { width: 100%; height: auto; display: block; }
.chart .axis { fill: var(--ink-3); font: 11px var(--f-mono); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart path[stroke] { stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: draw 1.2s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.empty { padding: 36px; text-align: center; color: var(--ink-3); }

/* ---------- Sorties ---------- */
.rel { display: flex; flex-direction: column; gap: 10px; }
.rel .date { font-family: var(--f-mono); font-size: .85rem; color: var(--ink-3); }
.hype { display: inline-flex; gap: 3px; }
.hype i { width: 20px; height: 6px; border-radius: 3px; background: var(--surface-3); }
.hype i.on { background: var(--holo); }

.toast { position: fixed; bottom: max(24px, env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 14px; z-index: 60; box-shadow: var(--shadow-2); font-weight: 550; animation: toastIn .35s var(--ease); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ---------- Images produits ---------- */
.pimg { flex: none; width: 76px; height: 76px; border-radius: 14px; background: #fff; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); position: relative; }
/* L'image tient toujours entière dans sa case (pas de rognage), quelle que soit sa forme */
.pimg img { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); object-fit: contain; transition: transform .4s var(--ease); }
.pimg.tile img, .pimg.big img { inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); }
.pimg.card img { inset: 0; width: 100%; height: 100%; }
.pimg.logo { background: var(--surface-2); padding: 10px; }
.pimg.card { background: none; border: 0; border-radius: 8px; }
.pimg.card img { object-fit: cover; border-radius: 8px; }
.pimg.none { background: var(--surface-3); color: var(--ink-3); font-size: .7rem; text-align: center; padding: 6px; line-height: 1.2; font-weight: 700; }
.pimg.big { width: 190px; height: 190px; border-radius: 18px; }
.pimg.tile { width: 100%; height: 170px; border-radius: 14px; background: linear-gradient(160deg, #fff, var(--surface-2)); border: 0; }
.pimg.card.tile img { object-fit: contain; }

/* ---------- Listes de produits ---------- */
.plist { display: flex; flex-direction: column; gap: 10px; }
.prow { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto auto; gap: 18px; align-items: center; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); cursor: pointer; text-align: left; width: 100%; box-shadow: var(--shadow-1); transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.prow:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.prow:hover .pimg img { transform: scale(1.05); }
.prow .pname { font-size: 1.04rem; }
.prow .price { text-align: right; min-width: 128px; }
.prow .price b { font-family: var(--f-mono); font-size: 1.15rem; font-weight: 500; display: block; letter-spacing: -.02em; }
.prow .price span { font-size: .82rem; color: var(--ink-3); }
.prow .side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 150px; }
.chg { font-family: var(--f-mono); font-size: .85rem; }
@media (max-width: 760px) {
  .prow { grid-template-columns: 62px minmax(0, 1fr); gap: 10px 14px; padding: 12px; }
  .prow .pimg { width: 62px; height: 62px; }
  .prow .price, .prow .side { grid-column: 2; text-align: left; align-items: flex-start; min-width: 0; }
  .prow .side { flex-direction: row; flex-wrap: wrap; }
}

/* ---------- Tuiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(226px, 1fr)); gap: 18px; }
.ptile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 14px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; text-align: left; width: 100%;
  box-shadow: var(--shadow-1); transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; }
.ptile:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.ptile:hover .pimg img { transform: scale(1.06); }
.ptile .pname { font-weight: 650; line-height: 1.3; font-size: 1rem; }
.ptile .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.ptile .px { font-family: var(--f-mono); font-size: 1.15rem; letter-spacing: -.02em; }
.rate { font-family: var(--f-mono); font-size: 1.6rem; font-weight: 500; line-height: 1; letter-spacing: -.03em; }
.rates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; font-size: .78rem; color: var(--ink-3); text-align: center; background: var(--surface-2); border-radius: 12px; padding: 8px 4px; }
.rates b { display: block; font-family: var(--f-mono); font-size: .92rem; font-weight: 500; margin-top: 2px; }
.rates .cur { color: var(--ink); }
.why { font-size: .86rem; color: var(--ink-2); line-height: 1.45; }
.rank { font-family: var(--f-mono); font-size: .78rem; color: var(--ink-3); }

/* ---------- Fourchette de prix ---------- */
.range-box { border-radius: var(--r-l); padding: 20px 22px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-1); position: relative; overflow: hidden; }
.range-box::after { content: ""; position: absolute; right: -60px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: var(--accent-soft); opacity: .7; }
.range-box > * { position: relative; z-index: 1; }
.range-box .lab { font-size: .85rem; color: var(--ink-3); font-weight: 600; }
.range-box .range-val { font-family: var(--f-mono); font-size: 2.1rem; font-weight: 500; margin: 4px 0 6px; letter-spacing: -.03em; }
.range-box.conf-hi { box-shadow: inset 0 0 0 1.5px var(--up), var(--shadow-1); }
.range-box.conf-mid { box-shadow: inset 0 0 0 1.5px var(--hold), var(--shadow-1); }
.range-box.conf-lo { box-shadow: inset 0 0 0 1.5px var(--wait), var(--shadow-1); }
.hype-chip { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.hype-chip::before { content: "▲"; font-size: .55rem; }
.hype-chip.hot { background: var(--holo); background-size: 200% 200%; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.25); animation: holo 6s ease-in-out infinite; }
.hype-chip.warm { background: var(--wait-soft); color: var(--wait); }
.hype-chip.mild { background: var(--surface-3); color: var(--ink-2); }
.hype-chip.cold { background: var(--surface-3); color: var(--ink-3); }
.src-table td { vertical-align: top; }
.keys-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.keys-form label { display: flex; flex-direction: column; gap: 4px; font-size: .86rem; color: var(--ink-2); }

/* ---------- Pépites ---------- */
.gem { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; padding: 22px; }
.gem-img { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.gem-img .pimg.big { width: 210px; height: 210px; }
.gem-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.gem-plan { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.gem-plan .kpi { box-shadow: none; background: var(--surface-2); }
.gem-plan .kpi .val { font-size: 1.25rem; }
details summary { cursor: pointer; color: var(--ink-2); font-weight: 550; }
@media (max-width: 760px) { .gem { grid-template-columns: 1fr; padding: 16px; } .gem-img .pimg.big { width: 170px; height: 170px; } }

/* ---------- Courbe 30 j / 7 j / aujourd'hui ---------- */
.curve { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: end; height: 140px; padding: 8px 6px 0; border-bottom: 1px solid var(--line); }
.cb { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.cb-bar { width: 44%; background: var(--chart); border-radius: 8px 8px 2px 2px; opacity: .55; transform-origin: bottom; animation: grow .8s var(--ease) both; }
.cb:nth-child(2) .cb-bar { opacity: .75; animation-delay: .08s; }
.cb:last-child .cb-bar { opacity: 1; animation-delay: .16s; }
@keyframes grow { from { transform: scaleY(0); } }
.cb-v { font-family: var(--f-mono); font-size: .86rem; }
.cb-l { font-size: .76rem; color: var(--ink-3); }

/* ---------- Analyse détaillée ---------- */
.insight { display: grid; gap: 16px; }
.insight-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.insight-score { display: flex; align-items: center; gap: 14px; }
.insight-score .big { font-family: var(--f-display); font-size: 2.6rem; font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.insight-score .big small { font-size: 1rem; color: var(--ink-3); font-weight: 600; margin-left: 2px; }
.insight-score .grade { width: 46px; height: 46px; font-size: 1.4rem; border-radius: 14px; }
.comp { display: grid; grid-template-columns: minmax(130px, 190px) 1fr 44px; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.comp:first-of-type { border-top: 0; }
.comp .cl { font-weight: 600; font-size: .95rem; }
.comp .cl span { display: block; font-size: .8rem; color: var(--ink-3); font-weight: 500; }
.meter { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px; transform-origin: left; animation: meter .9s var(--ease) both; }
@keyframes meter { from { transform: scaleX(0); } }
.meter i.s5 { background: var(--up); } .meter i.s4 { background: color-mix(in srgb, var(--up) 70%, var(--hold)); } .meter i.s3 { background: var(--hold); }
.meter i.s2 { background: var(--wait); } .meter i.s1 { background: var(--down); }
.comp .cs { font-family: var(--f-mono); text-align: right; font-size: .95rem; }
.comp details { grid-column: 1 / -1; }
.comp details summary { font-size: .84rem; color: var(--ink-3); font-weight: 500; }
.comp details ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); font-size: .9rem; display: grid; gap: 3px; }
.horizons { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.hz { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.hz .hl { font-size: .78rem; color: var(--ink-3); }
.hz .hv { font-family: var(--f-mono); font-size: 1.05rem; margin-top: 2px; }
.hz .hv.na { font-family: var(--f-body); font-size: .78rem; color: var(--ink-3); }
@media (max-width: 560px) { .comp { grid-template-columns: 1fr 44px; } .comp .meter { grid-column: 1 / -1; grid-row: 2; } }

/* ---------- Chargement ---------- */
.skeleton { border-radius: var(--r); background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; height: 86px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Animations d'apparition ---------- */
.anim { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 640px) {
  .brand-sub { display: none; }
  .d-head { flex-direction: column; }
  .d-head .pimg.big { width: 140px; height: 140px; }
  .hide-sm { display: none; }
  .drawer-panel { border-radius: 0; padding: 20px 16px 48px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Cloche d'alertes */
.bell { position: relative; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; display: grid; place-items: center; transition: transform .2s var(--ease), box-shadow .2s; }
.bell:hover { transform: translateY(-1px); box-shadow: var(--shadow-1); color: var(--ink); }
.bell-n { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--down); color: #fff; font: 700 .72rem/20px var(--f-body); text-align: center; animation: pop .4s var(--ease); }
@keyframes pop { from { transform: scale(0); } }
.alert-item { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.alert-item.unread { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.alert-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 1rem; }
.alert-ico.restock { background: var(--up-soft); } .alert-ico.target { background: var(--hold-soft); } .alert-ico.gem { background: var(--accent-soft); } .alert-ico.holding { background: var(--wait-soft); } .alert-ico.test { background: var(--surface-3); }

.img-missing { background: var(--surface-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='none' stroke='%238f97b4' stroke-width='1.6'%3E%3Crect x='3' y='2' width='16' height='18' rx='2'/%3E%3Cpath d='m3 15 5-5 4 4 3-3 4 4'/%3E%3C/svg%3E") no-repeat center; border-radius: 8px; }
.thumb { transition: opacity .3s; }

/* Interrupteurs */
.switches { display: flex; flex-wrap: wrap; gap: 10px; }
.switch { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 6px 14px 6px 6px; cursor: pointer; font-weight: 600; color: var(--ink-2); transition: all .2s var(--ease); }
.switch span { width: 38px; height: 22px; border-radius: 999px; background: var(--surface-3); position: relative; transition: background .25s var(--ease); flex: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .25s var(--ease); }
.switch.on { color: var(--ink); border-color: var(--up); }
.switch.on span { background: var(--up); }
.switch.on span::after { transform: translateX(16px); }

/* Recherche globale */
.find-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); cursor: pointer; font-weight: 500; }
.find-btn:hover { color: var(--ink); box-shadow: var(--shadow-1); }
.find-btn kbd { font: 600 .72rem var(--f-mono); background: var(--surface-3); border-radius: 6px; padding: 2px 6px; color: var(--ink-2); }
.finder { position: fixed; inset: 0; z-index: 70; display: grid; place-items: start center; padding-top: 12vh; }
.finder-back { position: absolute; inset: 0; background: rgba(9,13,24,.4); backdrop-filter: blur(4px); animation: fade .2s; }
.finder-box { position: relative; width: min(680px, 92vw); background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-2); overflow: hidden; animation: rise .3s var(--ease); }
.finder-box input { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 1.1rem; padding: 18px 20px 18px 48px; }
.finder-box input:focus { box-shadow: none; }
.finder-res { max-height: 60vh; overflow-y: auto; padding: 8px; }
.finder-res h4 { margin: 10px 12px 4px; font: 600 .78rem var(--f-body); color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.f-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 8px 12px; border-radius: 12px; cursor: pointer; width: 100%; border: 0; background: none; text-align: left; }
.f-item:hover, .f-item.sel { background: var(--surface-2); }
.f-item .pimg { width: 44px; height: 44px; border-radius: 10px; }
/* Accueil */
.home-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 900px) { .home-grid { grid-template-columns: 1fr; } }
.todo { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.todo:first-child { border-top: 0; }
.timeline { display: grid; gap: 10px; }
.tl { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.tl .d { text-align: center; background: var(--surface-2); border-radius: 12px; padding: 6px 0; font-family: var(--f-display); font-weight: 700; line-height: 1.1; }
.tl .d small { display: block; font: 500 .72rem var(--f-body); color: var(--ink-3); }
.fresh { display: flex; flex-wrap: wrap; gap: 8px; }
.fresh span { font-size: .8rem; padding: 4px 10px; border-radius: 999px; background: var(--up-soft); color: var(--up); font-weight: 600; }
.fresh span.late { background: var(--wait-soft); color: var(--wait); }

/* Les membres ne voient pas les outils d'administration */
body[data-role="member"] .admin-only { display: none !important; }
.tag.gold { background: color-mix(in srgb, var(--brand-cream) 45%, transparent); color: var(--ink); font-weight: 600; }
.kpi .val.up { color: var(--up); }

/* ---------- Téléphone ---------- */
html, body { overflow-x: clip; } /* jamais de défilement horizontal de la page */
@media (max-width: 640px) {
  .d-head { padding-right: 0; }
  .d-head > img { width: 180px; align-self: center; }
  .drawer-panel table th, .drawer-panel table td { padding: 8px 8px; font-size: .86rem; }
  .panel table, .note table { display: block; overflow-x: auto; max-width: 100%; }
  .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .price-grid .kpi { padding: 12px; }
  .price-grid .kpi .val { font-size: 1.15rem; }
  .pimg.tile { height: 190px; }
  .gem-img .pimg.big { width: 200px; height: 200px; }
  .kpis { gap: 10px; }
  h1 { font-size: 1.6rem; }
}
@media (max-width: 480px) {
  /* En-tête compact : logo seul, recherche, alertes et choix du jeu sur une ligne */
  .top-in { gap: 10px; padding-block: 10px 6px; flex-wrap: nowrap; }
  .brand-name { display: none; }
  .brand-mark { width: 36px; height: 36px; }
  .game-switch button { padding: 7px 12px; font-size: .88rem; white-space: nowrap; }
  .find-btn, .bell { width: 38px; height: 38px; padding: 0; justify-content: center; }
  .tabs a { padding: 7px 12px; font-size: .9rem; }
  .wrap { padding-block: 20px 80px; gap: 24px; }
}
.pimg.photo.tile, .pimg.photo.big { background: #fff; }
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis .kpi { padding: 14px; min-width: 0; }
  .kpis .kpi .val { font-size: 1.25rem; overflow-wrap: anywhere; }
  .kpis .kpi .sub { font-size: .78rem; }
}
