/* Styles propres à BinDex (le reste vient de base.css). */
/* Vue classeur d'une extension : pages de 9 cases qu'on tourne (comme un vrai classeur), à la hauteur de la fenêtre */
.card-grid.binder-mode { display: block; }
.binder-on .panel-head > p { display: none; }
.binder-mode .set-header { margin-bottom: 10px; }
.binder-book { display: flex; align-items: center; justify-content: center; gap: 10px; }
.binder-arrow {
  flex: none; width: 44px; height: 88px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--panel);
  color: var(--text); font-size: 2rem; line-height: 1; cursor: pointer;
}
.binder-arrow:hover:not(:disabled) { background: rgba(var(--ink), .1); }
.binder-arrow:disabled { opacity: .25; cursor: default; }
.binder-spread {
  position: relative; flex: 0 1 auto; width: calc(var(--pages) * var(--page-w, 420px)); min-width: 0;
  display: grid; grid-template-columns: repeat(var(--pages), minmax(0, 1fr)); perspective: 2600px; touch-action: pan-y;
}
.binder-page {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px; min-width: 0; height: 100%;
  background: linear-gradient(160deg, var(--page-a), var(--page-b)); border: 1px solid var(--border-strong); border-radius: 12px;
  box-shadow: inset 0 0 0 6px rgba(var(--ink), .02), 0 10px 24px rgba(0,0,0,.4);
}
/* Reliure : les deux pages se touchent, ombre au milieu */
.binder-spread > .binder-page:nth-child(1):not(:last-child) { border-radius: 12px 3px 3px 12px; box-shadow: inset -14px 0 18px -12px rgba(0,0,0,.7), 0 10px 24px rgba(0,0,0,.4); }
.binder-spread > .binder-page:nth-child(2) { border-radius: 3px 12px 12px 3px; box-shadow: inset 14px 0 18px -12px rgba(0,0,0,.7), 0 10px 24px rgba(0,0,0,.4); }
.binder-page-back { background: linear-gradient(160deg, var(--page-c), var(--page-d)); }
.binder-leaf { position: absolute; z-index: 5; transform-style: preserve-3d; pointer-events: none; will-change: transform; }
.leaf-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 12px; overflow: hidden; }
.leaf-face > .binder-page { border-radius: inherit; }
.leaf-back { transform: rotateY(180deg); }
.leaf-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,.15)); opacity: 0; pointer-events: none; }
.binder-foot { text-align: center; margin-top: 8px; }
.binder-slot { aspect-ratio: .718; border-radius: 6px; position: relative; cursor: pointer; min-width: 0; }
.binder-slot .real-art { height: 100%; }
.binder-slot.vacant, .binder-slot.blank {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; overflow: hidden;
  background: rgba(var(--ink), .03); border: 1px dashed var(--border); color: var(--muted); text-align: center; padding: 6px;
}
.binder-slot.vacant img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; filter: grayscale(1) brightness(.45); opacity: .55; }
.binder-slot.vacant span, .binder-slot.vacant small, .binder-slot.vacant em { position: relative; text-shadow: 0 1px 3px #000; }
.binder-slot.vacant span { font-weight: 800; font-size: 1.1rem; }
.binder-slot.vacant small { font-size: .68rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.binder-slot.vacant:hover { border-color: var(--primary); }
.binder-slot.blank { cursor: default; border-style: solid; opacity: .35; }
/* Versions reverse : étiquette (le reflet est l'effet .foil de css/base.css) */
.slot-variant {
  font-style: normal; font-size: .62rem; font-weight: 800; letter-spacing: .02em; padding: 2px 7px; border-radius: 99px;
  background: rgba(120,160,255,.25); color: #cfe0ff; white-space: nowrap;
}
.rev-p .slot-variant { background: rgba(255,90,90,.3); color: #ffd6d6; }
.rev-m .slot-variant { background: rgba(190,110,255,.32); color: #f0dcff; }
.binder-slot.rev .slot-variant { position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%); z-index: 2; box-shadow: 0 2px 6px rgba(0,0,0,.5); }

.brand-logo { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 4px 12px rgba(var(--accent-rgb), .4)); }
a.btn { text-decoration: none; }
.top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.icon-btn { padding: 7px; }
.icon-btn svg { width: 18px; height: 18px; display: block; }
.loading { text-align: center; color: var(--muted); padding: 60px 20px; }
.real-addbox, .real-import-box { min-width: 0; }
/* Largeur explicite : centrée par margin auto, la case prendrait sinon la largeur de son contenu, nulle pour les
   reverses Poké Ball / Master Ball (container-type: inline-size, css/base.css) : l'image disparaissait. */
@media (max-width: 700px) { .real-form { grid-template-columns: 1fr; } .real-form-art { width: 100%; max-width: 200px; margin: 0 auto; } }
@media (max-width: 760px) {
  .topbar, main { padding-left: 16px; padding-right: 16px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
}

/* ---------- Navigation : dans l'en-tête ; barre fixe en bas de l'écran sur téléphone ---------- */
.site-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(var(--ink), .04); border: 1px solid var(--border); }
.site-tabs .tab { display: flex; align-items: center; gap: 8px; padding: 8px 14px; }
.site-tabs .tab svg { width: 18px; height: 18px; flex: none; }
.site-tabs .tab.active { background: var(--primary); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(var(--accent-rgb), .35); }
a.tab { text-decoration: none; }
.view[hidden] { display: none; }
.view { animation: fade .2s; }
.account-btn { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
@media (min-width: 761px) and (max-width: 1040px) { .site-tabs .tab span { display: none; } .site-tabs .tab { padding: 8px 12px; } }

/* ---------- Bouton « ＋ » flottant et actions rapides ---------- */
.fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 40; width: 60px; height: 60px; border-radius: 20px;
  border: none; cursor: pointer; background: var(--primary); color: #fff; font-size: 2rem; line-height: 1;
  box-shadow: 0 12px 30px rgba(var(--accent-rgb), .45); transition: transform .15s, background .15s;
}
.fab:hover { background: var(--primary-2); transform: translateY(-2px); }
.fab:active { transform: scale(.95); }
.fab:focus-visible { outline: none; box-shadow: var(--ring), 0 12px 30px rgba(var(--accent-rgb), .45); }
/* ---------- Scan des cartes (js/scan.js) ---------- */
.scan-box { min-width: min(760px, 100%); }
.scan-box.drag { outline: 2px dashed var(--primary); outline-offset: 8px; border-radius: 12px; }
.scan-box h2 { margin: 0 0 14px; padding-right: 40px; }
.scan-fields { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.scan-set-field { grid-column: 1 / -1; }
.scan-box select { width: 100%; }
.scan-drop { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0 6px; padding: 14px;
  border: 1px dashed var(--border-strong); border-radius: 14px; background: var(--bg2); }
.scan-drop .btn { cursor: pointer; }
.scan-list { display: flex; flex-direction: column; gap: 10px; max-height: 52vh; overflow-y: auto; margin: 10px 0; }
.scan-row { display: grid; grid-template-columns: 56px 64px 1fr auto; gap: 12px; align-items: center; padding: 10px;
  border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: 12px; background: var(--panel2); }
.scan-row.is-sure { border-left-color: #3fb67a; }
.scan-row.is-check { border-left-color: #e3a72f; }
.scan-row.is-none { border-left-color: #e05555; }
/* Cartes proposées (autres cartes proches) : un clic la choisit */
.scan-alts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.scan-alt { padding: 0; border: 1px solid var(--border); border-radius: 5px; background: var(--bg2); cursor: pointer; overflow: hidden; line-height: 0; }
.scan-alt img { width: 34px; aspect-ratio: .718; object-fit: cover; display: block; }
.scan-alt span { display: block; padding: 4px; font-size: .65rem; line-height: 1.2; }
.scan-alt:hover { border-color: var(--primary); }
.scan-thumb { width: 56px; height: 78px; object-fit: cover; border-radius: 6px; background: var(--bg2); }
.scan-art img, .scan-art .real-noimg { width: 64px; aspect-ratio: .718; object-fit: cover; border-radius: 5px; display: block; }
.scan-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.scan-badge { font-weight: 700; font-size: .85rem; }
.is-sure .scan-badge { color: #3fb67a; } .is-check .scan-badge { color: #e3a72f; } .is-none .scan-badge { color: #e05555; }
.scan-row-fields { display: grid; grid-template-columns: 1fr 150px; gap: 8px; }
.scan-row select, .scan-row input { font: inherit; font-size: .9rem; background: var(--bg2); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.scan-row .qty-btn { width: 36px; }
.scan-remove { align-self: start; background: none; border: 0; color: var(--muted); font-size: 1rem; cursor: pointer; padding: 4px; }
.scan-remove:hover { color: var(--text); }
/* Cadrage : photo (ou vidéo) assombrie hors d'un cadre aux proportions d'une carte, déplaçable ; coin du numéro en pointillés */
.scan-framer { margin: 14px 0 6px; }
.scan-frame-help { margin: 0 0 10px; color: var(--text); }
.scan-stage { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; overflow: hidden; border-radius: 12px;
  background: #000; touch-action: none; user-select: none; cursor: crosshair; }
.scan-stage img, .scan-stage video { display: block; max-width: 100%; max-height: 62vh; }
/* Les boutons (.btn) ont un display qui l'emporterait sur l'attribut hidden. */
.scan-box [hidden] { display: none !important; }
.refresh-box [hidden] { display: none !important; }
.scan-frame { position: absolute; border: 3px solid #fff; border-radius: 4.5% / 3.3%; cursor: move;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55), 0 0 12px rgba(255, 255, 255, .5); }
.scan-frame::after { content: ''; position: absolute; left: 3%; bottom: 2.5%; width: 52%; height: 10%;
  border: 2px dashed #fff; border-radius: 6px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(0, 0, 0, .55); }
.scan-frame.no-corner::after { display: none; }
.scan-frame.flash { animation: scan-flash .4s ease-out; }
/* Détection en continu : carte ajoutée (cadre vert), bandeau avec son nom sur l'image, état de la recherche */
.scan-frame.added { animation: scan-added 1.2s ease-out; }
@keyframes scan-added { 0%, 40% { border-color: #3fb67a; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45), 0 0 0 4px rgba(63, 182, 122, .6); } }
.scan-live-note { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); max-width: 90%; z-index: 3;
  padding: 7px 14px; border-radius: 99px; background: rgba(18, 40, 28, .92); color: #b9f5d3; font-weight: 700; font-size: .9rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }
.scan-auto { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: .88rem; cursor: pointer; }
.scan-auto input { width: 18px; height: 18px; accent-color: var(--primary); }
.scan-live-state { margin: 6px 0 0; min-height: 1.2em; }
.scan-row.bump { animation: scan-bump .8s ease-out; }
@keyframes scan-bump { 0%, 30% { background: color-mix(in srgb, #3fb67a 22%, var(--panel)); } }
@keyframes scan-flash { from { background: rgba(255, 255, 255, .7); } to { background: transparent; } }
.scan-size { display: flex; align-items: center; gap: 12px; max-width: 420px; margin: 12px auto 0; font-size: .85rem; font-weight: 600; color: var(--muted); }
.scan-size input { flex: 1; accent-color: var(--primary); }
@media (max-width: 560px) {
  .scan-row { grid-template-columns: 48px 1fr auto; }
  .scan-thumb { display: none; }
  .scan-art img, .scan-art .real-noimg { width: 48px; }
  .scan-row-fields { grid-template-columns: 1fr; }
}
.quick-box h2 { margin: 0 0 16px; padding-right: 40px; }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 22px; }
.quick-box .quick-actions { margin-bottom: 0; }
.quick {
  display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); cursor: pointer; text-align: left;
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--border);
  transition: border-color .15s, transform .15s, background .15s;
}
.quick:hover { border-color: var(--primary); background: var(--panel2); transform: translateY(-2px); }
.quick-ico {
  flex: none; width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; background: rgba(var(--accent-rgb), .16);
}
.quick:nth-child(2) .quick-ico { background: rgba(var(--accent-rgb), .1); }
.quick:nth-child(3) .quick-ico { background: rgba(52, 211, 153, .16); }
.quick span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.quick b { font-size: 1rem; }
.quick small { color: var(--muted); font-size: .8rem; }

/* ---------- Menu « Outils » ---------- */
.pop-menu {
  position: absolute; z-index: 70; min-width: 260px; max-width: calc(100vw - 16px); padding: 6px;
  display: flex; flex-direction: column; gap: 2px; border-radius: 14px;
  background: var(--panel2); border: 1px solid var(--border-strong); box-shadow: 0 18px 40px rgba(0,0,0,.6); animation: rise .12s ease-out;
}
.pop-menu button {
  font: inherit; text-align: left; cursor: pointer; padding: 9px 12px; border-radius: 8px;
  background: none; border: none; color: var(--text); display: flex; flex-direction: column; gap: 1px;
}
.pop-menu button:hover:not(:disabled) { background: var(--bg2); }
.pop-menu button:disabled { opacity: .4; cursor: not-allowed; }
.pop-menu button small { color: var(--muted); font-size: .75rem; }
.pop-menu hr { border: none; border-top: 1px solid var(--border); margin: 4px 6px; }
.pop-title { padding: 6px 12px 4px; font-size: .72rem; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--gold); }
.bulk-box select { font: inherit; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.bulk-box .real-note { margin: 10px 0; }
.refresh-bar { margin: 12px 0 6px; }
.refresh-status { min-height: 1.2em; }

/* ---------- Tableau de bord ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi {
  display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--border); color: var(--text); text-decoration: none; transition: border-color .15s;
}
.kpi span { font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; }
.kpi b { font-size: 1.6rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi.gold { background: linear-gradient(140deg, rgba(var(--accent-rgb), .16), var(--panel) 60%); border-color: rgba(var(--accent-rgb), .3); }
.kpi small { color: var(--muted); font-size: .8rem; }
.kpi.gold b { color: var(--gold); }
a.kpi:hover { border-color: var(--gold); }
.dash-panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; min-width: 0; }
.dash-panel h3 { margin: 0 0 12px; }
.dash-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.dash-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 18px; }
.dash-cols > .dash-panel { margin-bottom: 18px; }
.dash-cols.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.dash-cards { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
/* Collection par langue : séries repliables (une ligne de résumé), extensions en tuiles compactes */
.dash-serie { border-top: 1px solid var(--border); }
.dash-serie:first-of-type { border-top: 0; }
.dash-serie-head {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 12px;
  padding: 12px 4px; border-radius: 10px;
}
.dash-serie-head::-webkit-details-marker { display: none; }
.dash-serie-head::before { content: '›'; font-size: 1.3rem; line-height: 1; color: var(--muted); transition: transform .15s; grid-row: 1; }
.dash-serie[open] > .dash-serie-head::before { transform: rotate(90deg); color: var(--text); }
.dash-serie-head:hover { background: rgba(var(--ink), .03); }
.dash-serie-name { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex-wrap: wrap; }
.dash-serie-name b { font-size: 1.02rem; }
.dash-serie-name small { color: var(--muted); font-size: .78rem; }
.dash-serie-side, .dash-set-side { display: flex; align-items: baseline; gap: 12px; white-space: nowrap; }
.dash-serie-head .set-bar { grid-column: 2 / -1; height: 4px; margin: 0; }
.dash-sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; padding: 2px 0 14px 22px; }
.dash-set {
  font: inherit; color: var(--text); text-align: left; cursor: pointer; width: 100%; min-width: 0;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 10px;
  padding: 9px 12px 10px; border-radius: 12px; background: var(--bg2); border: 1px solid transparent; transition: border-color .15s, background .15s;
}
.dash-set:hover { border-color: var(--primary); background: var(--panel2); }
.dash-set.empty-set { opacity: .55; }
.dash-set.is-done { border-color: rgba(63, 182, 122, .45); }
.dash-set-name { display: flex; flex-direction: column; min-width: 0; }
.dash-set-name b { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-set-name small { color: var(--muted); font-size: .72rem; }
.dash-set-side { flex-direction: column; align-items: flex-end; gap: 1px; }
.dash-set .set-bar { grid-column: 1 / -1; height: 4px; margin: 0; }
.dash-set .set-progress, .dash-serie-head .set-progress { margin: 0; font-size: .8rem; font-variant-numeric: tabular-nums; }
.dash-set-value { text-align: right; color: var(--gold); font-weight: 700; font-size: .82rem; font-variant-numeric: tabular-nums; }
.dash-row { display: grid; grid-template-columns: 130px 1fr 60px; gap: 10px; align-items: center; font-size: .88rem; margin-bottom: 6px; }
button.dash-row {
  width: 100%; font: inherit; font-size: .88rem; color: inherit; text-align: left; cursor: pointer;
  background: none; border: 0; border-radius: 8px; padding: 4px 6px; margin: 0 -6px 2px; box-sizing: content-box;
}
button.dash-row:hover { background: rgba(var(--ink), .05); }
button.dash-row:hover span { color: var(--primary-2); }
button.dash-row:focus-visible { outline: none; box-shadow: var(--ring); }
.bk-box h2 { margin-bottom: 2px; }
.bk-grid { margin-top: 14px; }
.bk-grid .real-more { grid-column: 1 / -1; }
.dash-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-row b { text-align: right; font-variant-numeric: tabular-nums; }
.dash-row .bar { height: 8px; }
.dash-free { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; font-size: .88rem; }
.dash-free div { display: grid; grid-template-columns: 1fr auto 70px; gap: 8px; }
.dash-free span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-free small { color: var(--muted); text-align: right; }

/* ---------- Pokédex ---------- */
.dex-bar { margin-top: 10px; max-width: 520px; }
.dex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.dex-tile {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 8px 10px; min-width: 0;
  border-radius: 12px; background: var(--panel); border: 1px solid var(--border); color: var(--text); text-decoration: none;
  opacity: .5; transition: opacity .15s, border-color .15s;
}
.dex-tile.owned { opacity: 1; }
.dex-tile:hover { opacity: 1; border-color: var(--gold); }
.dex-tile img { width: 72px; height: 72px; image-rendering: pixelated; }
.dex-tile:not(.owned) img { filter: grayscale(1) brightness(.7); }
.dex-tile small { color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; }
.dex-tile b { font-size: .85rem; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dex-count { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.dex-count em { color: var(--gold); font-style: normal; }
.dex-tile .bar { width: 100%; height: 5px; margin-top: 4px; }
.dex-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.dex-head { display: flex; gap: 24px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.dex-head > img { width: 180px; height: 180px; object-fit: contain; filter: drop-shadow(0 8px 18px rgba(0,0,0,.5)); }
.dex-head > div { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 6px; }
.dex-head h2 { margin: 0; font-size: 2rem; }
.dex-stats { display: flex; gap: 22px; flex-wrap: wrap; margin: 6px 0; }
.dex-stats div { display: flex; flex-direction: column; }
.dex-stats b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.dex-stats span { color: var(--muted); font-size: .8rem; }
.dex-tabs { margin-bottom: 0; }
@media (max-width: 760px) {
  .site-tabs { padding-left: 16px; padding-right: 16px; }
  .dash-cols { grid-template-columns: 1fr; }
  .dash-sets { grid-template-columns: 1fr; padding-left: 0; gap: 6px; }
  .dash-serie-name small { display: block; width: 100%; }
  .dash-serie-side { flex-direction: column; align-items: flex-end; gap: 0; }
  .dex-head > img { width: 120px; height: 120px; }
}

/* ---------- Rangement par langue ---------- */
.lang-header {
  grid-column: 1 / -1; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  margin: 26px 0 0; padding: 12px 16px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), .2), transparent); border-left: 4px solid var(--primary);
}
.lang-header:first-child { margin-top: 0; }
.lang-header b { font-size: 1.35rem; }
.lang-header span { color: var(--muted); font-size: .9rem; }
.serie-header {
  grid-column: 1 / -1; margin: 14px 0 -6px; font-size: .8rem; font-weight: 800; letter-spacing: .8px;
  text-transform: uppercase; color: var(--gold);
}
.dash-langs { margin-bottom: 10px; }
.dash-langs .tab { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.dash-langs .tab small { font-size: .72rem; color: var(--muted); font-weight: 600; }
.dash-lang-actions { display: flex; justify-content: flex-end; margin-bottom: 4px; }

/* Scellé (js/sealed.js) : photo du produit (TCGplayer) sur fond clair, icône du type si pas d'image */
.sealed-wrap { position: relative; }
.sealed-art {
  position: relative; aspect-ratio: 1; border-radius: 10px; background: #e9edf6; overflow: hidden;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 14px rgba(0,0,0,.45);
}
.sealed-icon { font-size: 2.6rem; opacity: .55; }
.sealed-art img.sealed-photo, .real-result .sealed-art img.sealed-photo {
  position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; border-radius: 0; background: #fff; z-index: 2;
}
/* Illustration générée (produit sans photo) : forme du type de produit, couleur et logo de l'extension */
.gen {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 90% at 50% 15%, hsl(var(--h) 45% 92%), hsl(var(--h) 30% 80%));
  container-type: inline-size;
}
.gen-prod {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4%;
  padding: 6%; text-align: center; overflow: hidden;
  background: linear-gradient(150deg, hsl(var(--h) 75% 58%), hsl(calc(var(--h) + 40) 70% 38%));
  box-shadow: 0 6cqw 10cqw rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.gen-prod::after { /* reflet */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .35) 48%, transparent 60%);
}
.gen-logo { position: relative; z-index: 1; width: 88%; max-height: 46%; object-fit: contain; filter: drop-shadow(0 1cqw 1.5cqw rgba(0, 0, 0, .45)); }
.gen-name {
  position: relative; z-index: 1; color: #fff; font-weight: 800; line-height: 1.1; font-size: max(7px, 8.5cqw);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.gen-logo + .gen-name { font-size: max(6px, 6cqw); opacity: .9; -webkit-line-clamp: 2; }
.gen-type {
  position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%); white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis;
  font-size: max(6px, 6.5cqw); font-weight: 700; color: hsl(var(--h) 40% 25%); letter-spacing: .02em;
}
/* Booster : sachet aux bords dentelés */
.gen-booster .gen-prod { width: 50%; height: 80%; margin-bottom: 6%; border-radius: 2px;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 8cqw 51% repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / 8cqw 51% repeat-x;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 8cqw 51% repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / 8cqw 51% repeat-x; }
/* Display : grande boîte, face avant avec fenêtre */
.gen-display .gen-prod { width: 82%; height: 58%; border-radius: 4px; margin-bottom: 8%; }
.gen-display .gen-prod::before { content: ''; position: absolute; left: 8%; right: 8%; bottom: 8%; height: 22%; border-radius: 3px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .5) 0 9%, rgba(255, 255, 255, .15) 9% 11%); }
/* ETB, coffrets, lots : boîte avec couvercle */
.gen-etb .gen-prod, .gen-box .gen-prod, .gen-lot .gen-prod, .gen-pcg .gen-prod, .gen-kit .gen-prod {
  width: 74%; height: 62%; border-radius: 5px; margin-bottom: 8%; border-top: 4cqw solid hsl(calc(var(--h) + 40) 60% 30%); }
.gen-etb .gen-prod { width: 66%; height: 66%; }
.gen-kit .gen-prod { width: 62%; height: 70%; }
/* Tin : boîte métallique aux coins arrondis */
.gen-tin .gen-prod { width: 64%; height: 64%; border-radius: 14%; margin-bottom: 8%;
  box-shadow: 0 6cqw 10cqw rgba(0, 0, 0, .35), inset 0 0 0 2.2cqw rgba(225, 230, 240, .75), inset 0 0 0 2.8cqw rgba(0, 0, 0, .25); }
/* Pièce : médaille dorée */
.gen-coin .gen-prod { width: 64%; aspect-ratio: 1; border-radius: 50%; margin-bottom: 8%;
  background: radial-gradient(circle at 35% 30%, #fff3b0, #e6b422 45%, #a8760c 100%);
  box-shadow: 0 5cqw 9cqw rgba(0, 0, 0, .35), inset 0 0 0 2.5cqw rgba(255, 255, 255, .35), inset 0 0 0 3.2cqw rgba(120, 80, 0, .35); }
.gen-coin .gen-name { color: #5a3d00; text-shadow: 0 1px 0 rgba(255, 255, 255, .5); }
/* Blister : carton avec trou d'accroche et bulle transparente */
.gen-blister .gen-prod { width: 58%; height: 78%; border-radius: 4px; margin-bottom: 6%; justify-content: flex-end; padding-bottom: 10%; }
.gen-blister .gen-prod::before { content: ''; position: absolute; top: 4%; left: 50%; width: 22%; height: 5%; transform: translateX(-50%);
  border-radius: 99px; background: hsl(var(--h) 30% 85%); }
.gen-blister .gen-logo { position: absolute; top: 14%; width: 70%; max-height: 32%;
  background: rgba(255, 255, 255, .28); border: 1px solid rgba(255, 255, 255, .6); border-radius: 6px; padding: 4%; }
/* Deck : boîte à cartes */
.gen-deck .gen-prod { width: 52%; height: 70%; border-radius: 4px 4px 3px 3px; margin-bottom: 8%; border-top: 5cqw solid rgba(0, 0, 0, .25); }
.real-result .sealed-art { box-shadow: none; border-radius: 6px; }
.sealed-form .real-form-art .sealed-art { max-width: 240px; }

/* Ouverture de booster (js/openings.js) et investissement (tableau de bord) */
.gain { color: var(--success); }
.loss { color: var(--danger); }
.opening-box h3 { margin: 6px 0 0; }
.opening-box .op-fields { margin: 12px 0; }
.opening-box .real-fields label { display: flex; flex-direction: column; gap: 5px; font-size: .85rem; color: var(--muted); }
.opening-box input, .opening-box select { min-width: 0; }
.op-results { max-height: 420px; }
.op-chosen { display: flex; align-items: center; gap: 12px; }
.op-chosen .sealed-art { width: 64px; flex: none; box-shadow: none; }
.op-chosen > div { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.op-chosen h2 { margin: 0; }
.op-sec-head { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 6px; }
.op-types { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.op-chip.active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 18%, var(--panel)); }
.op-chip small { color: var(--muted); margin-left: 2px; }
/* Mon scellé : vignettes (photo, nom, quantité), la liste défile au-delà de deux rangées environ */
.op-mine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; padding: 2px; }
.op-mine-grid.all { max-height: 420px; overflow-y: auto; } /* tout le scellé : la liste défile */
.op-tile {
  display: flex; flex-direction: column; gap: 4px; padding: 6px; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; min-width: 0; transition: border-color .15s, transform .15s;
}
.op-tile:hover { border-color: var(--gold); transform: translateY(-2px); }
.op-tile .sealed-art { width: 100%; box-shadow: none; border-radius: 8px; }
.op-tile b { font-size: .76rem; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.op-tile small { font-size: .7rem; color: var(--muted); }
.op-more { margin-top: 8px; }
.op-hint { margin: 10px 0 0; }
.op-chip { border: 1px solid var(--border); background: var(--panel); color: var(--text); border-radius: 20px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: .85rem; }
.op-chip:hover, .op-row:hover { border-color: var(--gold); }
.op-pq { width: 100%; }
.op-found { display: grid; gap: 6px; margin-top: 8px; max-height: 240px; overflow-y: auto; }
.op-row {
  display: flex; align-items: center; gap: 10px; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px;
}
.op-row .sealed-art { width: 40px; flex: none; box-shadow: none; border-radius: 6px; }
.op-row .sealed-icon { font-size: 1.2rem; }
.op-row span { display: flex; flex-direction: column; min-width: 0; }
.op-pulled { display: grid; gap: 6px; margin-top: 12px; max-height: 300px; overflow-y: auto; }
.op-card { display: flex; align-items: center; gap: 10px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; }
.op-card img, .op-card .real-noimg { width: 36px; aspect-ratio: .718; object-fit: cover; border-radius: 3px; flex: none; }
.op-card-name { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.op-card-name b, .op-card-name small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-qty { display: flex; align-items: center; gap: 6px; }
.op-card-value { min-width: 70px; text-align: right; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.op-total { margin-top: 10px; }
@media (max-width: 600px) { .op-card { flex-wrap: wrap; } .op-card-name { flex-basis: calc(100% - 50px); } }
.invest-panel { margin-bottom: 18px; }
.invest-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 10px 0; }
.invest-kpis > div { display: flex; flex-direction: column; gap: 2px; }
.invest-kpis span { color: var(--muted); font-size: .8rem; }
.invest-kpis b { font-size: 1.3rem; }
.invest-kpis small { color: var(--muted); font-size: .75rem; }
.op-history { display: grid; gap: 4px; margin-top: 8px; max-height: 320px; overflow-y: auto; }
.op-hist-row {
  display: grid; grid-template-columns: 90px 1fr 80px 80px 80px 90px; gap: 10px; align-items: center; text-align: left;
  font: inherit; font-size: .88rem; color: var(--text); background: none; border: 0; border-top: 1px solid var(--border); padding: 7px 4px; cursor: pointer;
}
.op-hist-row:hover { background: rgba(var(--ink), .04); }
.op-hist-row b:first-of-type { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-hist-row span { font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .op-hist-row { grid-template-columns: 1fr auto; } .op-hist-row > span:not(:last-child) { display: none; } }

/* ---------- Téléphone : navigation en bas, fenêtres en tiroir, champs pleine largeur ---------- */
@media (max-width: 760px) {
  .topbar { padding: 10px 16px; }
  .brand { font-size: 1.2rem; }
  .hide-sm { display: none; }
  .site-tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; justify-content: space-around; gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-radius: 0; border: 0; border-top: 1px solid var(--border);
    background: rgba(var(--shade2), .92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  }
  .site-tabs .tab { flex: 1; flex-direction: column; gap: 3px; padding: 6px 2px; font-size: .7rem; border: 0; }
  .site-tabs .tab svg { width: 22px; height: 22px; }
  .site-tabs .tab.active { background: none; box-shadow: none; color: var(--primary-2); }
  main { padding: 16px 16px calc(150px + env(safe-area-inset-bottom)); }
  .panel-head h2 { font-size: 1.45rem; }
  .fab { right: 16px; bottom: calc(78px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 18px; }
  #toasts { left: 16px; right: 16px; bottom: calc(146px + env(safe-area-inset-bottom)); max-width: none; }
  .overlay { align-items: flex-end; padding: 0; }
  .modal-box {
    margin: auto 0 0; max-height: 94vh; overflow-y: auto; overscroll-behavior: contain; border-radius: 22px 22px 0 0; border-bottom: 0;
    padding: 22px 16px calc(22px + env(safe-area-inset-bottom)); animation: sheet .22s ease-out;
  }
  .toolbar > input, .toolbar > select { flex: 1 1 140px; min-width: 0; }
  .toolbar > input[type="search"] { flex-basis: 100%; }
  .toolbar > .btn { flex: 1 1 auto; }
  .quick-actions { grid-template-columns: 1fr; gap: 8px; }
  .quick { padding: 12px 14px; }
}
@keyframes sheet { from { transform: translateY(40px); opacity: .4; } }

/* ---------- Téléphone : compléments d'ergonomie ---------- */
@media (max-width: 760px) {
  /* Le flou de l'en-tête faisait de lui le repère des éléments « fixed » qu'il contient : la navigation restait en haut.
     Sans flou, elle est bien fixée en bas de l'écran ; l'en-tête défile avec la page (plus de place pour le contenu). */
  .topbar { position: static; -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(var(--shade), .96); }
  .site-tabs .tab { min-height: 50px; justify-content: center; }
  .panel-head { margin-bottom: 12px; }
  .panel-head p { display: none; } /* textes d'aide : place gagnée sur petit écran */

  /* Accueil : actions rapides en 2 × 2, chiffres clés sur 2 colonnes (la valeur sur toute la largeur) */
  .quick-actions { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
  .quick { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .quick-ico { width: 38px; height: 38px; font-size: 1.15rem; border-radius: 12px; }
  .quick b { font-size: .9rem; }
  .quick small { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
  .kpi { padding: 12px 14px; }
  .kpi.gold { grid-column: 1 / -1; }
  .kpi b { font-size: 1.25rem; }
  .kpi small { font-size: .72rem; }
  .invest-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .invest-kpis b { font-size: 1.1rem; }
  .dash-panel { padding: 14px; margin-bottom: 14px; }
  .dash-cols, .dash-cols.three { grid-template-columns: 1fr; gap: 0; }
  /* Cartes les plus précieuses / derniers ajouts : une rangée de 8 cartes qui défile du doigt */
  .card-grid.dash-cards {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 36%; gap: 10px;
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; padding-bottom: 6px;
  }
  .card-grid.dash-cards > * { scroll-snap-align: start; }
  .card-grid.dash-cards > :nth-child(n + 9) { display: none; }

  /* Cartes : 3 par ligne, étiquettes plus discrètes ; barre d'outils plus serrée */
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .card-grid .pcard-name { font-size: .78rem; }
  .card-grid .muted.small { font-size: .68rem; }
  .real-tags .rarity-pill { font-size: .56rem; padding: 1px 5px; }
  .toolbar { gap: 8px; margin-bottom: 10px; }
  .toolbar input, .toolbar select { padding: 9px 10px; font-size: .9rem; }
  .toolbar > input[type="search"] { padding-left: 34px !important; }
  #real-summary { font-size: .8rem; }

  /* Pokédex : 3 par ligne, plus compact */
  .dex-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .dex-tile { padding: 6px 4px 8px; }
  .dex-tile img { width: 56px; height: 56px; }
  .dex-tile b { font-size: .78rem; }
}

/* ---------- Liste d'envies (js/wishlist.js) ---------- */
.wish-card { cursor: pointer; }
.wish-owned {
  position: absolute; top: 6px; left: 6px; z-index: 3; padding: 2px 8px; border-radius: 99px; font-size: .72rem; font-weight: 800;
  background: var(--success); color: #062a1c; box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}
.wish-max { margin-left: 6px; padding: 1px 7px; border-radius: 99px; font-size: .72rem; font-weight: 700; color: var(--muted); border: 1px solid var(--border-strong); }
.wish-max.ok { color: var(--success); border-color: var(--success); }
.wish-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: italic; }

/* ---------- Classeurs (js/binders.js) ---------- */
.ub-covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px; }
.ub-cover {
  position: relative; aspect-ratio: 3 / 4; border-radius: 8px 16px 16px 8px; overflow: hidden; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--cover) 80%, #fff 20%), var(--cover) 55%, color-mix(in srgb, var(--cover) 75%, #000 25%));
  box-shadow: 0 14px 30px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(255, 255, 255, .12); transition: transform .2s, box-shadow .2s;
}
.ub-cover:hover { transform: translateY(-4px) rotate(-1deg); box-shadow: 0 20px 40px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .18); }
.ub-cover::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 28px; background: rgba(0, 0, 0, .25); box-shadow: inset -2px 0 0 rgba(0, 0, 0, .2); }
.ub-rings { position: absolute; left: 6px; top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: space-evenly; }
.ub-rings i { display: block; width: 22px; height: 8px; border-radius: 4px; background: linear-gradient(#ffe08a, #c99a2e); box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.ub-cover-body { position: absolute; left: 40px; right: 14px; bottom: 16px; display: flex; flex-direction: column; gap: 4px; text-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.ub-cover-body b { font-size: 1.15rem; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.ub-cover-body small { opacity: .85; font-size: .78rem; }
.ub-new {
  font: inherit; cursor: pointer; color: var(--muted); background: rgba(var(--ink), .03); border: 2px dashed var(--border-strong); box-shadow: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.ub-new::before { display: none; }
.ub-new span { font-size: 2.6rem; line-height: 1; color: var(--primary-2); }
.ub-new:hover { color: var(--text); border-color: var(--primary); transform: translateY(-4px); }
.ub-head { display: flex; flex-direction: column; gap: 4px; }
.ub-head h2 { display: flex; align-items: center; gap: 10px; }
.ub-dot { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.ub-back { color: var(--primary-2); text-decoration: none; font-weight: 600; font-size: .9rem; }
.ub-back:hover { text-decoration: underline; }
.ub-hint { margin-bottom: 10px; padding: 10px 14px; border-radius: 12px; background: rgba(var(--accent-rgb), .14); border: 1px solid rgba(var(--accent-rgb), .35); font-weight: 600; }
/* Le classeur ouvert : couverture autour des pages, anneaux sur la reliure */
.ub-book .binder-spread {
  width: calc(var(--pages) * var(--page-w, 420px) + 28px); padding: 14px; border-radius: 18px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--cover) 85%, #fff 15%), color-mix(in srgb, var(--cover) 80%, #000 20%));
  box-shadow: 0 24px 50px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .15);
}
.ub-book .binder-spread::after {
  content: ''; position: absolute; top: 18%; bottom: 18%; width: 14px; z-index: 6; pointer-events: none;
  background: linear-gradient(#f3d27a, #c99a2e) 0 0 / 100% 12px no-repeat, linear-gradient(#f3d27a, #c99a2e) 0 50% / 100% 12px no-repeat,
    linear-gradient(#f3d27a, #c99a2e) 0 100% / 100% 12px no-repeat;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5));
}
.ub-2 .binder-spread::after { left: calc(50% - 7px); }
.ub-1 .binder-spread::after { left: 7px; }
.ub-slot { position: relative; transition: transform .15s, outline-color .15s; }
.ub-slot:not(.ub-empty):hover { transform: translateY(-3px); z-index: 2; }
.ub-empty {
  display: flex; align-items: center; justify-content: center; background: rgba(var(--ink), .03); border: 1px dashed var(--border-strong);
  color: var(--muted); font-size: 1.4rem; opacity: .7;
}
.ub-empty:hover { opacity: 1; border-color: var(--primary); color: var(--primary-2); }
.ub-missing .real-art { filter: grayscale(1) brightness(.6); opacity: .65; }
.ub-own {
  position: absolute; top: 4px; right: 4px; z-index: 3; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: .7rem; font-weight: 800; background: var(--success); color: #062a1c; box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
.ub-moving { outline: 3px solid var(--primary); outline-offset: 2px; }
.ub-over { outline: 3px dashed var(--primary-2); outline-offset: 2px; }
.ub-dragging { opacity: .35; }
.ub-form { display: flex; flex-direction: column; gap: 14px; }
.ub-form label:not(.ub-check), .ub-field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.ub-form input:not([type="checkbox"]), .ub-form select {
  font: inherit; font-weight: 400; background: var(--bg2); color: var(--text); border: 1px solid var(--border-strong); border-radius: 12px; padding: 10px 12px;
}
.ub-form input:focus, .ub-form select:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.ub-check { display: flex; gap: 10px; align-items: center; font-size: .92rem; cursor: pointer; }
.ub-check input { width: 18px; height: 18px; accent-color: var(--primary); }
.show-sm { display: none; }
@media (max-width: 760px) {
  .show-sm { display: inline; }
  .ub-toolbar > .btn { flex: 0 1 auto; }
  .ub-toolbar .toolbar-spacer { flex: 1; }
  .top-actions { flex-wrap: nowrap; gap: 6px; min-width: 0; }
  .account-btn { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
  .ub-covers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .ub-cover-body b { font-size: 1rem; }
  .ub-book .binder-arrow { display: none; }
  .ub-book .binder-spread { padding: 10px 10px 10px 26px; }
}
.real-result .gen-logo { width: 88%; aspect-ratio: auto; object-fit: contain; border-radius: 0; background: none; }
.gen-blister .gen-logo, .real-result .gen-blister .gen-logo { width: 70%; background: rgba(255, 255, 255, .28); border-radius: 6px; }

/* ---------- Amis (js/friends.js) ---------- */
.tab, .icon-btn { position: relative; }
.icon-btn.active { border-color: var(--primary); color: var(--primary-2); }
.icon-btn .tab-badge { top: -6px; right: -6px; }
.tab-badge {
  position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; font-style: normal;
  font-size: .68rem; font-weight: 800; line-height: 18px; text-align: center; background: var(--danger); color: #fff;
}
.fr-add { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 22px; }
.fr-add input {
  font: inherit; flex: 1 1 220px; max-width: 320px; background: var(--bg2); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 10px 12px;
}
.fr-add input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.fr-msg { color: var(--danger); }
.fr-section { margin-bottom: 26px; }
.fr-section > h3 { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.fr-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 8px;
  border-radius: 14px; background: var(--panel); border: 1px solid var(--border);
}
.fr-avatar { line-height: 1; font-size: 1rem;
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
}
.fr-avatar.big { width: 56px; height: 56px; font-size: 1.4rem; }
.fr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.fr-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 14px; border-radius: 18px; text-decoration: none;
  color: var(--text); background: var(--panel); border: 1px solid var(--border); transition: transform .15s, border-color .15s;
}
.fr-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.fr-head h2 { display: flex; align-items: center; gap: 10px; }
.fr-tabs { margin-bottom: 14px; }
.fr-tabs .tab { text-decoration: none; }
.fr-tile { cursor: default; }
.real-card.fr-tile:hover .real-art { transform: none; }
.ub-ro { cursor: default; opacity: .4; }


/* ---------- Photos de profil (UI.avatar, js/account.js) ---------- */
.avatar {
  flex: none; display: inline-grid; place-items: center; overflow: hidden; border-radius: 50%; font-weight: 800; line-height: 1; color: #fff;
  background: linear-gradient(135deg, var(--primary-2), var(--primary)); box-shadow: 0 0 0 2px rgba(var(--ink), .12);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-sm { width: 24px; height: 24px; font-size: .75rem; }
.avatar-md { width: 40px; height: 40px; font-size: 1.05rem; }
.avatar-lg { width: 96px; height: 96px; font-size: 2.2rem; }
.account-btn { display: inline-flex; align-items: center; gap: 8px; padding-left: 6px; }
.set-profile > div { display: flex; align-items: center; gap: 12px; }
.set-profile span:not(.avatar) { display: flex; flex-direction: column; }
.set-profile small { color: var(--muted); }
.avatar-box h3 { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 10px; }
.avatar-current { display: flex; justify-content: center; margin: 10px 0 4px; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px; }
.avatar-pick {
  padding: 0; border: 3px solid transparent; border-radius: 50%; overflow: hidden; aspect-ratio: 1; cursor: pointer; background: var(--bg2);
  transition: transform .15s, border-color .15s;
}
.avatar-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-pick:hover { transform: scale(1.06); }
.avatar-pick.on { border-color: var(--primary); }
.avatar-pick:focus-visible { outline: none; box-shadow: var(--ring); }
.fr-card .avatar-lg { width: 64px; height: 64px; font-size: 1.5rem; }
/* Téléphone : bouton du profil au format des boutons voisins (icône de 18 px, 7 px autour), photo de profil seule */
@media (max-width: 760px) {
  .account-btn:has(.avatar) { padding: 6px; gap: 0; }
  .account-btn .account-name { display: none; }
  .account-btn .avatar-sm { width: 20px; height: 20px; font-size: .7rem; }
}

/* ---------- Listes d'envies : une pastille par liste ---------- */
.wish-lists { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.wish-chip {
  font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; color: var(--text); background: var(--panel); border: 1px solid var(--border-strong);
}
.wish-chip small { font-size: .75rem; color: var(--muted); background: rgba(var(--ink), .08); border-radius: 99px; padding: 1px 7px; }
.wish-chip.on { background: var(--primary); border-color: transparent; color: #fff; }
.wish-chip.on small { color: #fff; background: rgba(255, 255, 255, .22); }
.wish-chip:hover:not(.on) { border-color: var(--primary); }
.wish-new { border-style: dashed; color: var(--muted); }
.wish-choices { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.wish-choices .btn { justify-content: space-between; }

/* ---------- Évolution de la collection (js/history.js) ---------- */
.hist-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.hist-head h3 { margin: 0 0 4px; }
.hist-hero { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hist-hero b { font-size: 1.7rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.hist-change { font-weight: 600; font-variant-numeric: tabular-nums; }
.hist-ranges { display: inline-flex; background: var(--panel2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.hist-ranges button { border: 0; background: none; color: var(--muted); font: inherit; font-size: .82rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.hist-ranges button:hover { color: var(--text); }
.hist-ranges button.active { background: var(--primary); color: #fff; }
.hist-ranges button:focus-visible { outline: none; box-shadow: var(--ring); }
.hist-plot { position: relative; width: 100%; touch-action: pan-y; }
.hist-plot svg { display: block; overflow: visible; }
.hist-grid { stroke: var(--border); stroke-width: 1; }
.hist-line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.hist-end, .hist-dot { fill: var(--primary); stroke: var(--panel); stroke-width: 2; }
.hist-cross { stroke: var(--border-strong); stroke-width: 1; }
.hist-x, .hist-y { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.hist-tip { position: absolute; pointer-events: none; background: var(--panel3); border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 8px 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; white-space: nowrap; font-size: .8rem; color: var(--muted); z-index: 2; }
.hist-tip[hidden] { display: none; }
.hist-tip b { color: var(--text); font-size: .95rem; font-variant-numeric: tabular-nums; }
.hist-empty { margin: 8px 0 4px; }
.hist-table { margin-top: 10px; }
.hist-table summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.hist-table-wrap { max-height: 280px; overflow: auto; margin-top: 8px; }
.hist-table table { width: 100%; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums; }
.hist-table th, .hist-table td { text-align: right; padding: 5px 8px; border-bottom: 1px solid var(--border); }
.hist-table th:first-child, .hist-table td:first-child { text-align: left; }
.hist-table th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--panel); }
.hist-tip em { font-style: normal; font-size: .75rem; color: var(--muted); opacity: .85; }
.hist-note { font-size: .78rem; margin: 6px 0 0; }
.hist-skel { display: flex; flex-direction: column; gap: 14px; }
.hist-skel span { display: block; height: 34px; width: 220px; border-radius: 10px; background: var(--panel2); animation: hist-pulse 1.2s ease-in-out infinite alternate; }
.hist-skel span:last-child { height: 230px; width: 100%; }
@keyframes hist-pulse { from { opacity: .45; } to { opacity: 1; } }
.tools-row { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; margin: -4px 0 14px; }
.tools-row .summary-line { margin: 0 0 0 4px; flex: 1 1 260px; }
.tools-row select { width: auto; }
/* Largeurs fixes : la ligne des filtres ne change pas de taille selon la langue ou l'extension choisie */
@media (min-width: 761px) {
  #real-filter { width: 240px; flex: none; }
  #real-filter-lang { width: 190px; flex: none; }
  #real-filter-set { width: 300px; flex: none; }
  #real-sort { width: 170px; flex: none; }
}
@media (max-width: 760px) {
  .tools-row > .btn, .tools-row > select { flex: 1 1 auto; }
  .tools-row .summary-line { flex-basis: 100%; margin: 0; }
}
@media (min-width: 761px) { .fr-set { width: 300px; flex: none; } }
/* Fiche d'une carte d'un ami (js/friends.js) */
.fr-tile { cursor: pointer; }
.fr-info h2 { margin: 0 0 6px; }
.fr-status { margin: 16px 0 10px; padding: 10px 14px; border-radius: 12px; font-weight: 700; }
.fr-status.ok { background: rgba(52, 211, 153, .12); color: var(--success); border: 1px solid rgba(52, 211, 153, .3); }
.fr-status.miss { background: var(--panel2); color: var(--muted); border: 1px dashed var(--border-strong); }
.fr-copies { width: 100%; border-collapse: collapse; font-size: .9rem; margin-bottom: 10px; }
.fr-copies th, .fr-copies td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); }
.fr-copies th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.fr-mine { color: var(--gold); font-weight: 600; margin: 8px 0; }
/* Bandeau cookies (UI.consent) */
.consent {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 95; max-width: 720px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; padding: 14px 16px; border-radius: 16px;
  background: var(--panel); border: 1px solid var(--border-strong); box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
  animation: rise .3s cubic-bezier(.2, .8, .2, 1);
}
.consent p { margin: 0; flex: 1 1 320px; font-size: .9rem; line-height: 1.45; color: var(--text); }
.consent p b { margin-right: 4px; }
.consent-actions { display: flex; gap: 8px; margin-left: auto; }
@media (max-width: 760px) { body:not(.guest) .consent { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }
/* Pied de page (connecté) et liens légaux de la présentation */
.site-foot { text-align: center; color: var(--muted); font-size: .78rem; padding: 18px 16px 28px; }
.site-foot a, .ld-legal a { color: var(--muted); }
.site-foot a:hover, .ld-legal a:hover { color: var(--text); }
body.guest .site-foot { display: none; }
@media (max-width: 760px) { .site-foot { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); } }
.auth-form label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
/* Fiche d'une carte : tous ses exemplaires */
.copies { margin: 6px 0 4px; border-top: 1px solid var(--border); padding-top: 12px; }
.copies h3 { margin: 0 0 8px; font-size: .95rem; }
.copies-wrap { overflow-x: auto; }
.copies table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.copies th, .copies td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.copies th { color: var(--muted); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.copies tbody tr { cursor: pointer; }
.copies tbody tr:hover { background: var(--panel2); }
.copies tbody tr.on { background: rgba(var(--accent-rgb), .12); cursor: default; }
/* Code court d'une extension (PBL, MEW, SV2a…) à côté de son nom */
.set-code { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  color: var(--muted); background: var(--panel2); border: 1px solid var(--border); vertical-align: middle; font-variant-numeric: tabular-nums; }
/* Rareté (SAR, UR…) et version particulière (ALT, Full Art, Gold, Rainbow) sous les cartes */
.real-tags .rarity-code { background: color-mix(in srgb, var(--primary) 18%, transparent); border-color: color-mix(in srgb, var(--primary) 45%, transparent);
  color: color-mix(in srgb, var(--primary) 70%, var(--text)); }
.real-tags .card-tag { color: #fff; border-color: transparent; text-shadow: 0 1px 1px rgba(0,0,0,.35); }
.real-tags .tag-alt { background: linear-gradient(135deg, #7b5cff, #d24dff); }
.real-tags .tag-fa { background: linear-gradient(135deg, #4a6fa5, #6c8fc7); }
.real-tags .tag-gold { background: linear-gradient(135deg, #b8862b, #e7c45a 55%, #a8741c); }
.real-tags .tag-rainbow { background: linear-gradient(120deg, #e8577a, #f0a24b, #8fd16a, #4bb3e8, #9d6ff0); }

/* ---------- Badges (js/badges.js) ---------- */
.badges-panel { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; width: 100%; text-align: left; cursor: pointer;
  font: inherit; color: var(--text); border: 1px solid var(--border); }
.badges-panel:hover { border-color: rgba(var(--accent-rgb), .45); }
.badges-panel h3 { margin: 0 0 2px; }
.badges-strip { display: flex; gap: 4px; font-size: 1.4rem; }
.badge-next { grid-column: 1 / -1; display: grid; gap: 6px; }
.badges-panel .bar, .badge-card .bar { height: 6px; border-radius: 99px; background: rgba(var(--ink), .08); overflow: hidden; }
.badges-panel .bar i, .badge-card .bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--primary-2)); }
.badges-box { width: min(860px, 100%); }
.badges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin: 14px 0; }
.badge-card { display: flex; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--panel2); opacity: .78; }
.badge-card.done { opacity: 1; border-color: rgba(var(--accent-rgb), .45); background: linear-gradient(135deg, rgba(var(--accent-rgb), .14), var(--panel2) 60%); }
.badge-card > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.badge-emoji { font-size: 1.9rem; line-height: 1; filter: grayscale(1); }
.badge-card.done .badge-emoji { filter: none; }
.badge-when { color: var(--success); }
.badge-reward { color: var(--gold); font-weight: 600; }
/* Réglages : thèmes, couleurs et icônes verrouillés ; choix de l'icône */
.theme-card.locked, .swatch.locked { opacity: .45; cursor: not-allowed; }
.swatch.locked { position: relative; }
.swatch.locked::after { content: '🔒'; position: absolute; inset: 0; display: grid; place-items: center; font-size: .7rem; }
.icons-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-pick { position: relative; width: 44px; height: 44px; padding: 4px; border-radius: 12px; border: 2px solid transparent; background: var(--panel2); cursor: pointer; }
.icon-pick img { width: 100%; height: 100%; display: block; }
.icon-pick.on { border-color: var(--primary); }
.icon-pick.locked { cursor: not-allowed; }
.icon-pick.locked img { opacity: .35; filter: grayscale(1); }
.icon-pick i { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: .9rem; }

/* ---------- Onglet Admin (js/admin.js) ---------- */
.admin-me h3 { margin: 0 0 10px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-q {
  width: 260px; max-width: 100%; font: inherit; font-size: .92rem; color: var(--text); background-color: var(--bg2);
  border: 1px solid var(--border-strong); border-radius: 12px; padding: 9px 12px 9px 36px;
  transition: border-color .15s, box-shadow .15s;
}
.admin-q:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.admin-q::placeholder { color: var(--muted); }
#view-admin .dash-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#view-admin .dash-title h3 { margin: 0; }
.admin-table-wrap { overflow-x: auto; margin-top: 10px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.admin-table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.admin-table tr:hover td { background: rgba(var(--ink), .03); }
.admin-user { display: inline-flex; align-items: center; gap: 8px; }
.admin-chip { font-style: normal; font-size: .68rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: rgba(var(--accent-rgb), .18); color: var(--primary-2); }
.admin-chip.me { background: rgba(var(--ink), .08); color: var(--muted); }
.admin-row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.admin-money { display: inline-flex; gap: 4px; }
.admin-money input { width: 90px; font: inherit; font-size: .88rem; color: var(--text); background: var(--bg2); border: 1px solid var(--border-strong); border-radius: 10px; padding: 6px 8px; }
.admin-money input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.admin-log { margin: 0; padding: 12px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--border); font-size: .78rem; line-height: 1.5; white-space: pre-wrap; max-height: 260px; overflow: auto; }

/* ---------- Pré-gradation (js/pregrade.js) ---------- */
a.quick { text-decoration: none; }
.pg-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 12px; }
.pg-shot { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); }
.pg-shot small { min-height: 2.4em; }
.pg-preview { display: grid; place-items: center; height: 220px; width: 100%; max-width: 100%; border-radius: 10px;
  border: 1px dashed var(--border-strong); background: var(--bg2); overflow: hidden; font-size: 2.4rem; }
.pg-preview img { max-width: 100%; max-height: 220px; object-fit: contain; }
.pg-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.pg-tips { max-width: 70ch; margin: 0 0 12px; line-height: 1.5; }
.pg-go { margin-bottom: 18px; }
.pg-summary { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; padding: 16px; margin-bottom: 14px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--border-strong); }
.pg-summary p { flex: 1 1 280px; margin: 0; line-height: 1.5; }
.pg-final { display: flex; flex-direction: column; gap: 2px; min-width: 150px; }
.pg-final b { font-size: 2rem; line-height: 1.1; color: var(--primary); font-variant-numeric: tabular-nums; }
.pg-crits { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.pg-crit { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); }
.pg-crit > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pg-crit strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.pg-crit small { line-height: 1.4; }
.pg-conf { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; letter-spacing: .02em; }
.pg-conf.good { background: rgba(46, 180, 110, .16); color: #1f9a5c; }
.pg-conf.mid { background: rgba(230, 160, 30, .18); color: #b67a08; }
.pg-conf.low { background: rgba(var(--ink), .08); color: var(--muted); }
.pg-views { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.pg-views figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.pg-canvas { position: relative; width: 100%; max-width: 420px; }
.pg-canvas canvas { width: 100%; height: auto; border-radius: 8px; display: block; }
.pg-canvas svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pg-line line { vector-effect: non-scaling-stroke; }
.pg-line .hit { stroke: transparent; stroke-width: 16; touch-action: none; }
.pg-line.v .hit { cursor: ew-resize; }
.pg-line.h .hit { cursor: ns-resize; }
.pg-line .seen { stroke-width: 1.5; pointer-events: none; }
.pg-line.outer .seen { stroke: #3fe08a; }
.pg-line.inner .seen { stroke: #2fd6ff; stroke-dasharray: 6 4; }
.pg-line:hover .seen, .pg-line.drag .seen { stroke-width: 3; stroke-dasharray: none; }
.pg-help { margin: 0 0 10px; line-height: 1.5; }
.pg-canvas svg { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@media (pointer: coarse) { .pg-line .hit { stroke-width: 30; } }
/* Pendant qu'on fait glisser une ligne : la page ne défile plus (ni rebond, ni sélection de texte). */
html.pg-dragging, html.pg-dragging body { overflow: hidden; overscroll-behavior: none; touch-action: none; -webkit-user-select: none; user-select: none; }
.pg-key { display: inline-flex; align-items: center; gap: 4px; margin-right: 8px; }
.pg-key::before { content: ''; width: 10px; height: 10px; border-radius: 3px; }
.pg-key.green::before { background: #3fe08a; }
.pg-key.red::before { background: #ff283c; }
.pg-key.yellow::before { background: #ffdc00; }
.pg-key.cyan::before { background: #2fd6ff; }

/* ---------- Échanges entre amis (js/trades.js) ---------- */
.tr-intro { margin: 0 0 10px; max-width: 75ch; line-height: 1.5; }
.tr-mode { margin-bottom: 14px; }
.tr-col { margin-bottom: 18px; }
.tr-tile { cursor: pointer; position: relative; border: 2px solid transparent; border-radius: 12px; transition: border-color .15s; }
.tr-tile.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); }
.tr-pick { position: absolute; top: 6px; left: 6px; z-index: 3; padding: 2px 8px; border-radius: 99px; background: var(--primary); color: #fff; font-weight: 800; font-size: .8rem; }
.tr-qty { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 4px; }
.tr-qty button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--panel2); color: var(--text); font: inherit; font-weight: 800; cursor: pointer; }
.tr-bar { position: sticky; bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); z-index: 20; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 12px 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border-strong); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.tr-balance { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; flex: 1 1 320px; font-variant-numeric: tabular-nums; }
.tr-arrow { color: var(--primary); font-weight: 800; }
.tr-diff { padding: 2px 10px; border-radius: 99px; font-size: .8rem; font-weight: 700; }
.tr-diff.even { background: rgba(46, 180, 110, .16); color: #2bb673; }
.tr-diff.plus { background: rgba(59, 130, 246, .16); color: #4f8ff7; }
.tr-diff.minus { background: rgba(230, 160, 30, .18); color: #d99a1c; }
.tr-msg { flex: 1 1 220px; min-width: 0; font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.tr-card { padding: 12px 14px; margin-bottom: 10px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); }
.tr-card.st-pending { border-color: color-mix(in srgb, var(--primary) 55%, var(--border)); }
.tr-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tr-card-head .muted { margin-left: auto; }
.tr-sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 18px; }
.tr-sides p { margin: 4px 0 0; line-height: 1.45; font-size: .88rem; }
.tr-note { margin: 8px 0 0; font-style: italic; color: var(--muted); }
.tr-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.tr-actions:empty { display: none; }
.tr-possible { display: grid; gap: 8px; }
.tr-match { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.tr-match:hover { border-color: var(--primary); }
.tr-match > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.tr-match .fr-go { color: var(--primary); font-weight: 700; white-space: nowrap; }
.tr-done { margin-top: 10px; }
.tr-done summary { cursor: pointer; margin-bottom: 8px; }
/* Barre de l'échange : le bouton « ＋ » s'efface (il la recouvrirait) ; sur téléphone, au-dessus de la navigation du bas. */
body:has(.tr-bar) .fab { display: none; }
@media (max-width: 760px) { .tr-bar { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); } }

/* ---------- Profil public (js/friends.js, #/u/<pseudo>) ---------- */
.pub-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--primary) 14%, var(--panel)); border: 1px solid color-mix(in srgb, var(--primary) 40%, var(--border)); }
.pub-banner span { flex: 1 1 260px; line-height: 1.45; }
.pub-link { font-size: .82rem; word-break: break-all; color: var(--primary); }
.set-btns { display: inline-flex; gap: 6px; flex-wrap: wrap; }
/* Visiteur sans compte sur un profil public : seulement le profil (le bandeau propose de créer sa collection). */
body.pub-guest .fab, body.pub-guest .site-tabs, body.pub-guest #btn-friends, body.pub-guest #btn-settings, body.pub-guest #btn-admin, body.pub-guest #btn-game { display: none !important; }

/* ---------- Alertes (js/alerts.js) ---------- */
#btn-alerts { position: relative; }
.alerts-box { width: min(560px, 100%); }
.al-list { display: grid; gap: 6px; margin-bottom: 18px; max-height: 46vh; overflow-y: auto; }
.al-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 10px 12px; border-radius: 12px;
  background: var(--panel2); border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.al-item:hover { border-color: var(--primary); }
.al-item.new { border-color: color-mix(in srgb, var(--primary) 60%, var(--border)); background: color-mix(in srgb, var(--primary) 9%, var(--panel2)); }
.al-item > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.al-item small { line-height: 1.4; color: var(--muted); }
.al-ico { font-size: 1.2rem; line-height: 1.2; }

/* ---------- Faut-il grader ? (js/gradecalc.js) ---------- */
.gc-box { width: 100%; }
/* Fenêtre à la largeur de son contenu (sinon 900 px, avec un grand vide à droite) */
.modal-box:has(.gc-box) { max-width: 680px; }
.gc-card { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.gc-card > img, .gc-card .card-img, .gc-card > :first-child { width: 64px; flex: none; border-radius: 5px; }
.gc-card > div { display: flex; flex-direction: column; gap: 2px; }
.gc-verdict { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--border-strong); }
.gc-verdict b { font-size: 1.15rem; }
.gc-verdict.good { border-color: rgba(46, 180, 110, .6); background: rgba(46, 180, 110, .1); }
.gc-verdict.good b { color: #2bb673; }
.gc-verdict.mid { border-color: rgba(230, 160, 30, .6); background: rgba(230, 160, 30, .1); }
.gc-verdict.mid b { color: #d99a1c; }
.gc-verdict.bad { border-color: rgba(239, 68, 68, .55); background: rgba(239, 68, 68, .08); }
.gc-verdict.bad b { color: #ef5b5b; }
.gc-verdict strong { font-variant-numeric: tabular-nums; }
.gc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 12px; }
.gc-grid label, .gc-find { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.gc-grid input, .gc-grid select, .gc-find input, .gc-table input { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; min-width: 0; }
.gc-wide { grid-column: 1 / -1; }
.gc-find { margin-bottom: 8px; }
.gc-hits { display: grid; gap: 6px; margin-bottom: 12px; }
.gc-hits:empty { display: none; }
.gc-hit { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel2); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.gc-hit:hover { border-color: var(--primary); }
.gc-hit > :first-child { width: 36px; flex: none; }
.gc-hit span { display: flex; flex-direction: column; }
.gc-table-wrap { overflow-x: auto; margin-bottom: 8px; }
.gc-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.gc-table th { text-align: left; font-size: .75rem; color: var(--muted); font-weight: 600; padding: 4px 6px; }
.gc-table td { padding: 5px 6px; border-top: 1px solid var(--border); }
.gc-table input { width: 100px; }
.gc-plus { color: #2bb673; font-weight: 700; }
.gc-minus { color: #ef5b5b; }
.pg-final .btn { margin-top: 8px; align-self: flex-start; }

/* ---------- Mode salon du scan (js/scan.js) ---------- */
.scan-salon-toggle { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer;
  background: var(--panel2); border: 1px solid var(--border); font-size: .88rem; line-height: 1.35; }
.scan-salon-toggle input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.scan-box.salon .scan-salon-toggle { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, var(--panel2)); }
.scan-box.salon .scan-row-fields .qty-step { display: none; }
.scan-salon:empty { display: none; }
.scan-salon { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.sal-price { font-size: 1.5rem; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; line-height: 1.1; }
.sal-price small { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); }
.sal-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sal-tag { padding: 3px 9px; border-radius: 99px; font-size: .78rem; font-weight: 700; }
.sal-tag.own { background: rgba(230, 160, 30, .18); color: #d99a1c; }
.sal-tag.new { background: rgba(46, 180, 110, .16); color: #2bb673; }
.sal-tag.wish { background: rgba(236, 72, 153, .16); color: #e9579b; }
.scan-salon .btn { align-self: flex-start; }

/* ---------- Ce qu'il me manque (js/shoplist.js) ---------- */
.shop-btn { margin-left: auto; }
.shop-box { width: min(640px, 100%); }
.shop-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; padding: 12px 14px; margin: 8px 0 12px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--border-strong); }
.shop-sum b { font-size: 1.2rem; }
.shop-sum strong { color: var(--primary); font-variant-numeric: tabular-nums; }
.shop-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.shop-list { display: grid; gap: 4px; max-height: 48vh; overflow-y: auto; margin-bottom: 8px; }
.shop-row { display: grid; grid-template-columns: auto 34px 1fr auto; gap: 10px; align-items: center; padding: 5px 8px; border-radius: 10px; background: var(--panel2); cursor: pointer; }
.shop-row.off { opacity: .45; }
.shop-row input { width: 17px; height: 17px; accent-color: var(--primary); }
.shop-art { width: 34px; line-height: 0; }
.shop-art img { width: 100%; border-radius: 3px; }
.shop-name { display: flex; flex-direction: column; min-width: 0; }
.shop-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Calendrier des sorties (js/releases.js) et outils de l'accueil ---------- */
.dash-tools { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; padding-bottom: 2px; }
.dash-tools::-webkit-scrollbar { display: none; }
.dash-tool { flex: none; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--panel); color: var(--text);
  font: inherit; font-size: .86rem; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.dash-tool:hover { border-color: var(--primary); }
.rel-section { margin-bottom: 24px; }
.rel-section > h3 { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.rel-row { display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; margin-bottom: 8px;
  border-radius: 12px; background: var(--panel); border: 1px solid var(--border); }
.rel-row.up { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.rel-date { display: flex; flex-direction: column; align-items: center; line-height: 1.05; padding: 6px 0; border-radius: 10px; background: var(--panel2); }
.rel-date b { font-size: 1.35rem; } .rel-date span { font-size: .75rem; text-transform: uppercase; font-weight: 700; color: var(--primary); } .rel-date small { font-size: .68rem; color: var(--muted); }
.rel-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rel-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.rel-admin { margin-bottom: 18px; padding: 10px 14px; border-radius: 12px; background: var(--panel); border: 1px dashed var(--border-strong); }
.rel-admin summary { cursor: pointer; font-weight: 600; }
.rel-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 12px; }
.rel-form label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.rel-form input, .rel-form select { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; min-width: 0; }
.rel-wide { grid-column: 1 / -1; }
.rel-mini { display: flex; flex-direction: column; padding: 6px 0; border-top: 1px solid var(--border); }
.rel-mini:first-of-type { border-top: 0; }


/* ---------- Notification de l'administrateur (js/admin.js) ---------- */
.admin-push-form { display: grid; gap: 10px; max-width: 720px; }
.admin-push-form label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.admin-push-form input, .admin-push-form textarea, .admin-push-form select { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-width: 0; resize: vertical; }
.admin-push-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.admin-push-preview { display: flex; gap: 10px; align-items: flex-start; max-width: 380px; padding: 10px 12px; border-radius: 14px; background: var(--panel2); border: 1px solid var(--border-strong); }
.admin-push-preview img { width: 36px; height: 36px; border-radius: 8px; }
.admin-push-preview span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.admin-push-preview small { color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.rel-src { margin: -4px 0 12px; }
.rel-src a { color: var(--primary); }
/* Visuel d'une sortie (img/releases/, copié la nuit depuis le planning Margxt) */
.rel-row.has-img { grid-template-columns: 58px 112px 1fr auto; }
.rel-img { width: 112px; aspect-ratio: 16 / 9; object-fit: contain; border-radius: 8px; background: var(--panel2); }
/* Disposition par zones : date, image, texte, boutons (sur téléphone, le texte et les boutons passent sous la date et l'image) */
.rel-date { grid-area: date; } .rel-img { grid-area: img; } .rel-info { grid-area: info; } .rel-acts { grid-area: acts; }
.rel-row { grid-template-areas: "date info acts"; }
.rel-row.has-img { grid-template-areas: "date img info acts"; }
@media (max-width: 560px) {
  .rel-row, .rel-row.has-img { grid-template-columns: 52px minmax(0, 1fr); grid-template-areas: "date info" "acts acts"; gap: 10px 12px; }
  .rel-row.has-img { grid-template-areas: "date img" "info info" "acts acts"; }
  .rel-img { width: 100%; max-width: 260px; justify-self: start; }
  .rel-info b { line-height: 1.3; }
  .rel-acts { justify-content: flex-start; }
}
/* Choix d'une liste d'envies : création d'une nouvelle liste (js/wishlist.js, chooseList) */
.wish-newlist { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.wish-newlist input { flex: 1; min-width: 0; font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
/* Boutons masqués (attribut hidden : Administration pour les non-administrateurs, cloche sans compte…) : le style des
   boutons (display: inline-flex) ne doit pas les faire réapparaître. */
.btn[hidden], .icon-btn[hidden] { display: none !important; }

/* Chargement de la collection depuis le compte (js/app.js, sync) : écran plein, éventail de cartes qui s'ouvre et se referme */
.collection-loading {
  position: fixed; inset: 0; z-index: 95; display: grid; place-items: center;
  padding: max(24px, env(safe-area-inset-top, 0px)) 16px max(24px, env(safe-area-inset-bottom, 0px));
  background: radial-gradient(60% 50% at 50% 42%, rgba(var(--accent-rgb, 124, 108, 255), .22), transparent 70%), var(--bg);
  transition: opacity .45s ease, visibility .45s;
}
.collection-loading.leaving { opacity: 0; visibility: hidden; }
.collection-loading[hidden] { display: none; }
.cl-stage { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.cl-logo { width: 64px; height: 64px; animation: cl-float 2.4s ease-in-out infinite; filter: drop-shadow(0 8px 24px rgba(var(--accent-rgb, 124, 108, 255), .45)); }
.cl-fan { position: relative; width: 210px; height: 150px; }
.cl-card {
  position: absolute; left: 50%; bottom: 0; width: 82px; aspect-ratio: .718; margin-left: -41px; border-radius: 8px;
  transform-origin: 50% 120%; overflow: hidden;
  background: linear-gradient(150deg, var(--primary-2, #a78bfa), var(--primary, #7c6cff) 55%, color-mix(in srgb, var(--primary, #7c6cff) 55%, #000));
  border: 3px solid color-mix(in srgb, var(--primary, #7c6cff) 35%, #fff);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .45);
  animation: cl-fan 2.6s cubic-bezier(.55, 0, .3, 1) infinite;
}
/* Dos de carte : cercle façon Poké Ball, et un reflet qui passe */
.cl-card::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%;
  background: linear-gradient(to bottom, rgba(255,255,255,.92) 0 46%, rgba(0,0,0,.35) 46% 54%, rgba(255,255,255,.35) 54%);
  box-shadow: 0 0 0 3px rgba(0,0,0,.25), inset 0 0 0 6px transparent;
}
.cl-card::after {
  content: ''; position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.45) 50%, transparent 60%);
  animation: cl-shine 2.6s ease-in-out infinite;
}
.cl-card:nth-child(1) { --a: -36deg; --x: -18px; animation-delay: 0s; }
.cl-card:nth-child(2) { --a: -18deg; --x: -9px; animation-delay: .06s; }
.cl-card:nth-child(3) { --a: 0deg;   --x: 0px;  animation-delay: .12s; z-index: 3; }
.cl-card:nth-child(4) { --a: 18deg;  --x: 9px;  animation-delay: .18s; z-index: 4; }
.cl-card:nth-child(5) { --a: 36deg;  --x: 18px; animation-delay: .24s; z-index: 5; }
@keyframes cl-fan {
  0%, 8% { transform: translateX(0) rotate(0deg) translateY(0); }
  38%, 62% { transform: translateX(var(--x)) rotate(var(--a)) translateY(-6px); }
  92%, 100% { transform: translateX(0) rotate(0deg) translateY(0); }
}
@keyframes cl-shine { 0%, 30% { transform: translateX(-60%); } 60%, 100% { transform: translateX(60%); } }
@keyframes cl-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.cl-text { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--text); }
.cl-bar { position: relative; width: 180px; height: 4px; border-radius: 4px; overflow: hidden; background: rgba(var(--accent-rgb, 124, 108, 255), .18); }
.cl-bar span { position: absolute; inset: 0 auto 0 0; width: 40%; border-radius: inherit; background: var(--primary, #7c6cff); animation: cl-bar 1.3s ease-in-out infinite; }
@keyframes cl-bar { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
/* Animation figée seulement avec le réglage « Animations » de BinDex désactivé (pas celui du système : les sessions
   Bureau à distance de Windows coupent les animations du système). */
html.reduce-motion .cl-bar span { width: 100%; opacity: .6; }
html.reduce-motion .cl-logo, html.reduce-motion .cl-card, html.reduce-motion .cl-card::after, html.reduce-motion .cl-bar span { animation: none; }
html.reduce-motion .cl-card { transform: translateX(var(--x)) rotate(var(--a)); }

/* Lien vers Cardmarket (fenêtre d'une carte) */
.cm-link { display: inline-flex; align-items: center; gap: 4px; width: fit-content; margin-top: -4px; color: var(--primary, #7c6cff); font-weight: 600; text-decoration: none; }
.cm-link:hover, .cm-link:focus-visible { text-decoration: underline; }

/* Petite vignette de carte hors des grilles (Faut-il grader ?, liste de courses) : cadre de la fiche texte des cartes sans image */
.mini-art { display: block; box-shadow: none; }
.mini-art .real-blank { padding: 3px; gap: 2px; border-radius: inherit; }
.mini-art .real-blank b { font-size: .5rem; line-height: 1.15; }
.mini-art .real-blank small { display: none; }
