/* Cards&Freaks — mobile d'abord. Les règles de base visent le téléphone ; @media (min-width: 900px) adapte à l'ordinateur. */
:root {
    --bg: #f6f5ff;
    --surface: #ffffff;
    --surface-2: #eeedfb;
    --text: #1b1a2e;
    --muted: #6b6a85;
    --border: #dcdaf2;
    --primary: #3730a3;
    --primary-text: #ffffff;
    --accent: #f59e0b;
    --ok: #15803d;
    --danger: #b91c1c;
    --danger-bg: #fee2e2;
    --ok-bg: #dcfce7;
    --warn: #92400e;
    --warn-bg: #fef3c7;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(30, 27, 75, .08), 0 4px 14px rgba(30, 27, 75, .06);
    --tabs-h: 64px;
    --safe-b: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1020;
        --surface: #1a1b30;
        --surface-2: #25274a;
        --text: #ececff;
        --muted: #9a9bbd;
        --border: #2f3156;
        --primary: #818cf8;
        --primary-text: #0f1020;
        --ok: #4ade80;
        --danger: #fca5a5;
        --danger-bg: #4c1d1d;
        --ok-bg: #14391f;
        --warn: #fcd34d;
        --warn-bg: #4a3512;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    background: var(--bg); color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans CJK JP", sans-serif;
    font-size: 16px; line-height: 1.45; -webkit-tap-highlight-color: transparent;
}
a { color: var(--primary); }
h1 { font-size: 1.4rem; margin: 0 0 .75rem; }
h2 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }
h1:focus { outline: none; }
p { margin: .4rem 0; }
.muted { color: var(--muted); font-size: .9rem; }

/* ---------- Démarrage ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: .75rem; }
.boot-logo { width: 72px; height: 72px; border-radius: 18px; background: var(--primary); color: var(--primary-text); display: grid; place-content: center; font-weight: 800; font-size: 1.4rem; }
.boot-text { color: var(--muted); }

/* ---------- Coque de l'application ---------- */
.shell { min-height: 100vh; padding-bottom: calc(var(--tabs-h) + var(--safe-b)); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
    padding: .6rem 1rem; padding-top: calc(.6rem + env(safe-area-inset-top, 0px)); background: var(--primary); color: var(--primary-text); }
.brand { display: flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; font-weight: 700; }
.brand-mark { background: var(--accent); color: #3730a3; border-radius: 8px; padding: .1rem .4rem; font-weight: 800; font-size: .9rem; }
.topbar-user { font-size: .9rem; opacity: .9; }
.content { max-width: 1100px; margin: 0 auto; }
.page { padding: 1rem; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: var(--surface);
    border-top: 1px solid var(--border); padding-bottom: var(--safe-b); height: calc(var(--tabs-h) + var(--safe-b)); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--muted); text-decoration: none; font-size: .7rem; min-height: 48px; }
.tab { position: relative; }
.tab-ico { font-size: 1.35rem; line-height: 1; }
.tab-badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--danger); color: var(--surface); font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; }
@media (min-width: 900px) { .tab-badge { position: static; margin-left: auto; } }
.tab.active { color: var(--primary); font-weight: 700; }

@media (min-width: 900px) {
    .shell { padding-bottom: 0; padding-left: 220px; }
    .topbar { margin-left: -220px; }
    .tabs { top: 56px; bottom: 0; right: auto; width: 220px; flex-direction: column; justify-content: flex-start; height: auto;
        border-top: 0; border-right: 1px solid var(--border); padding: 1rem .75rem; gap: .25rem; }
    .tab { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: .75rem; padding: .65rem .85rem; border-radius: 10px; font-size: 1rem; }
    .tab.active { background: var(--surface-2); }
    .page { padding: 1.5rem; }
}

/* ---------- Écrans de connexion ---------- */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.auth-logo { width: 64px; height: 64px; border-radius: 16px; background: var(--primary); color: var(--primary-text); display: grid; place-content: center; font-weight: 800; margin: 0 auto .5rem; }
.auth-card h1 { text-align: center; }
.tagline { text-align: center; color: var(--muted); margin-bottom: 1rem; }

/* ---------- Formulaires ---------- */
label.field { display: block; margin: .75rem 0; font-size: .9rem; color: var(--muted); }
label.field > span { display: block; margin-bottom: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=date], input[type=time], input[type=url], select, textarea {
    width: 100%; padding: .7rem .8rem; font-size: 1rem; color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: 10px; min-height: 46px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.check { display: flex; gap: .6rem; align-items: flex-start; margin: .9rem 0; font-size: .95rem; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.row { display: flex; gap: .6rem; }
.row > * { flex: 1; min-width: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 46px; padding: .6rem 1.1rem;
    border: 0; border-radius: 12px; font-size: 1rem; font-weight: 600; cursor: pointer; background: var(--primary); color: var(--primary-text); text-decoration: none; }
.btn.block { width: 100%; }
.btn.secondary { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--danger-bg); color: var(--danger); }
.btn.small { min-height: 38px; padding: .35rem .8rem; font-size: .9rem; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.alert { padding: .7rem .9rem; border-radius: 10px; margin: .75rem 0; font-size: .95rem; }
.alert.error { background: var(--danger-bg); color: var(--danger); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }

/* ---------- Puces, onglets internes ---------- */
.chips { display: flex; gap: .45rem; overflow-x: auto; padding: .25rem 0 .6rem; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: .45rem .9rem; border-radius: 999px; background: var(--surface-2); color: var(--text); border: 0; font-size: .9rem; cursor: pointer; min-height: 38px; }
.chip.on { background: var(--primary); color: var(--primary-text); font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: .75rem; }
.stat { background: var(--surface); border-radius: var(--radius); padding: .7rem .5rem; text-align: center; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.25rem; }
.stat span { font-size: .75rem; color: var(--muted); }

/* ---------- Grille de cartes ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; } }

.tile { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.tile.clickable { cursor: pointer; }
.tile-img { position: relative; aspect-ratio: 5 / 7; background: var(--surface-2); display: grid; place-content: center; }
.tile-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile-fallback { font-size: 2.2rem; font-weight: 800; color: var(--muted); }
.badge-corner { position: absolute; top: 6px; right: 6px; background: var(--accent); color: #3a2a00; font-weight: 700; font-size: .78rem; padding: .1rem .5rem; border-radius: 999px; }
.tile-body { padding: .5rem .6rem .65rem; display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.tile-name { font-weight: 700; font-size: .95rem; line-height: 1.2; }
.tile-meta { font-size: .78rem; color: var(--muted); }
.tile-price { font-size: .85rem; }
/* Cartes asiatiques : nom et extension tels qu'imprimés, sous la traduction. */
.tile-native { font-size: .76rem; color: var(--muted); line-height: 1.25; }
.tile-ver { display: inline-block; margin-top: .15rem; padding: .05rem .45rem; border-radius: 999px; font-size: .7rem; background: var(--chip-bg, rgba(99,102,241,.12)); color: var(--muted); }
.photo-mark { position: absolute; left: .35rem; bottom: .35rem; font-size: .8rem; background: rgba(0,0,0,.55); border-radius: 999px; padding: 0 .35rem; }
.photo-box { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .4rem 0; }
.photo-box input[type=file] { display: none; }
.version-picker { border: 1px dashed var(--line, rgba(128,128,128,.4)); border-radius: 10px; padding: .6rem; margin: .6rem 0; }
.version-picker .grid { margin-top: .6rem; }
.tile-actions { display: flex; gap: .4rem; margin-top: auto; padding-top: .4rem; }
.tile-actions .btn { flex: 1; padding: .3rem .4rem; }
.tags { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .2rem; }
.tag { font-size: .72rem; padding: .08rem .45rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tag.sale { background: var(--ok-bg); color: var(--ok); }
.tag.trade { background: var(--accent); color: #3a2a00; }

/* ---------- Progression ---------- */
.set-row { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem; margin-bottom: .6rem; }
.set-row-head { display: flex; justify-content: space-between; gap: .5rem; font-weight: 600; }
.bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: .5rem 0; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 999px; }

/* ---------- Fenêtre (feuille du bas sur mobile) ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(10, 10, 30, .55); display: flex; align-items: flex-end; justify-content: center; }
.modal { width: 100%; min-height: min(78vh, 680px); max-height: 92vh; overflow-y: auto; background: var(--surface); border-radius: 20px 20px 0 0; padding: 1rem 1rem calc(1rem + var(--safe-b)); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.modal-head h2 { margin: 0; }
.modal-close { background: none; border: 0; font-size: 1.6rem; color: var(--muted); cursor: pointer; min-width: 44px; min-height: 44px; }
.modal-card { display: flex; gap: .8rem; align-items: center; margin-bottom: .5rem; }
.modal-card img { width: 88px; border-radius: 6px; }
/* ---------- Radar et propositions ---------- */
.item { display: flex; gap: .8rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: .7rem; margin-bottom: .7rem;
        color: inherit; text-decoration: none; }
.item-img { position: relative; width: 84px; flex: none; aspect-ratio: 5 / 7; border-radius: 6px; overflow: hidden; background: var(--surface-2);
            display: grid; place-content: center; }
.item-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.item-actions { margin-top: auto; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.chips.wrap { flex-wrap: wrap; overflow-x: visible; }
.item.meeting { border-left: 4px solid var(--primary); }
.item.meeting.set { border-left-color: var(--ok); }
.item.meeting.declined { border-left-color: var(--danger); }
.link-btn { background: none; border: 0; padding: 0 .4rem 0 0; margin-left: .5rem; color: var(--muted); font-size: .8rem; text-decoration: underline; cursor: pointer; }
.thread li { align-items: flex-start; }
.qr-box { background: #fff; border-radius: 12px; padding: .6rem; max-width: 320px; margin: .5rem auto; }
.qr-box svg { display: block; width: 100%; height: auto; }
.payload { display: block; word-break: break-all; font-size: .75rem; padding: .5rem; margin-top: .4rem; background: var(--surface-2); border-radius: 8px; color: var(--text); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 .4rem; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 .9rem .9rem; display: flex; flex-direction: column; gap: .1rem; }
.timeline li::before { content: ""; position: absolute; left: -.42rem; top: .35rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--primary); }
.cm-row .btn { margin-right: .4rem; }
.private-note { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: .6rem .8rem; margin: .4rem 0; font-size: .9rem; }
.private-note .muted { color: inherit; opacity: .8; }
.stats.one { grid-template-columns: 1fr; }
.stats.two { grid-template-columns: repeat(2, 1fr); }
a.stat { color: inherit; text-decoration: none; }
.amount { font-weight: 700; white-space: nowrap; }
.amount.plus { color: var(--ok); }
.amount.minus { color: var(--danger); }
.pill { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--danger-bg); color: var(--danger); }
.people { list-style: none; margin: .2rem 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.people li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.prop-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.prop-cards { display: flex; gap: .6rem; flex-wrap: wrap; }
.prop-card { display: flex; gap: .4rem; align-items: center; font-size: .8rem; }
.prop-card .item-img { width: 44px; }
.cm-row { margin: 0 0 .75rem; }
.cm-link { display: inline-block; text-decoration: none; }
.card-picture { background: none; border: 0; padding: 0; cursor: zoom-in; flex: 0 0 auto; }
.card-picture img { display: block; }
/* Image agrandie : la fenêtre de détails ne garde que son titre et l'image, qui la remplit (la fenêtre s'ajuste à l'image). */
.viewer { position: relative; display: flex; justify-content: center; cursor: zoom-out; }
/* Une carte fait 63 x 88 mm : la plus grande largeur qui tient dans la fenêtre (92vh, moins marges et titre). */
.viewer img { width: min(100%, calc((92vh - 6rem) * .716)); height: auto; border-radius: 4.5% / 3.2%; }
.modal:has(.viewer) > :not(.modal-head):not(.modal-card) { display: none; }
.modal:has(.viewer) .modal-card { display: block; margin: 0; }
.modal:has(.viewer) .modal-card > :not(.viewer) { display: none; }
.viewer-close { position: absolute; top: 8px; right: 8px; z-index: 1; /* au-dessus de l'image */ width: 44px; height: 44px; border: 0; border-radius: 50%;
                background: rgba(0, 0, 0, .55); color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; }
@media (min-width: 700px) {
    .modal-backdrop { align-items: center; }
    .modal { max-width: 460px; border-radius: 20px; padding-bottom: 1rem; }
}

/* ---------- Scan ---------- */
.scanner { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; --ar: .75; aspect-ratio: var(--ar); width: min(100%, calc(66vh * var(--ar))); margin: 0 auto; }
.scanner video { width: 100%; height: 100%; object-fit: contain; display: block; }
.scan-guide { position: absolute; top: 5%; height: 90%; left: 50%; transform: translateX(-50%); aspect-ratio: 63 / 88; border: 3px dashed rgba(255, 255, 255, .85); border-radius: 14px; pointer-events: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); }
.scan-hint { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; color: #fff; font-size: .8rem; text-shadow: 0 1px 3px #000; }
.scanner-off { aspect-ratio: auto; width: 100%; padding: 1.2rem; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.scan-actions { display: flex; gap: .6rem; margin: .75rem 0; flex-wrap: wrap; }
.scan-actions .btn { flex: 1 1 140px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.read-text { font-family: ui-monospace, monospace; font-size: .8rem; background: var(--surface-2); padding: .5rem; border-radius: 8px; white-space: pre-wrap; max-height: 5rem; overflow: auto; }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty .big { font-size: 2.4rem; }

.spinner { display: inline-block; width: 18px; height: 18px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs-h) + var(--safe-b) + 12px); z-index: 120; background: var(--text); color: var(--bg);
    padding: .7rem 1.1rem; border-radius: 999px; box-shadow: var(--shadow); width: max-content; max-width: 90vw; text-align: center; }
@media (min-width: 900px) { .toast { bottom: 24px; } }

#blazor-error-ui { background: var(--danger-bg); color: var(--danger); bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2); display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* Champ mot de passe avec œil (afficher / masquer) */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap input { width: 100%; padding-right: 2.8rem; }
.pw-toggle { position: absolute; top: 50%; right: .4rem; transform: translateY(-50%); display: grid; place-items: center; width: 2.2rem; height: 2.2rem; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--muted, #888); cursor: pointer; }
.pw-toggle:hover { color: var(--text, #222); }
.pw-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }

/* Albums */
.album-row { display: block; width: 100%; text-align: left; background: var(--surface); color: inherit; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem; margin-bottom: .6rem; cursor: pointer; font: inherit; }
.album-row:hover { filter: brightness(1.08); }
.album-row .set-row-head { display: flex; justify-content: space-between; gap: .5rem; font-weight: 600; }
.album-banner { margin: .2rem 0 .6rem; }
.auto-albums { background: var(--surface); border-radius: var(--radius); padding: .8rem; margin-bottom: .8rem; }
.scan-cost { font-size: .85rem; background: var(--surface); border-radius: var(--radius); padding: .5rem .7rem; margin: .4rem 0 .6rem; }
.scan-photo-row { display: flex; gap: .8rem; align-items: center; margin: .4rem 0 .6rem; }
.scan-photo { height: 110px; width: auto; border-radius: 8px; box-shadow: var(--shadow); }

/* Blason, profil public, albums publics */
.avatar { display: inline-grid; place-content: center; flex: none; border-radius: 50%; line-height: 1; user-select: none;
    background: hsl(var(--hue) 75% 88%); border: 2px solid hsl(var(--hue) 60% 55%); }
@media (prefers-color-scheme: dark) { .avatar { background: hsl(var(--hue) 35% 24%); border-color: hsl(var(--hue) 55% 55%); } }
.avatar-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: .5rem; margin: .5rem 0 1rem; }
.avatar-choice { display: grid; place-items: center; padding: .25rem; border-radius: 12px; border: 2px solid transparent; background: var(--surface); cursor: pointer; min-height: 56px; }
.avatar-choice:hover { filter: brightness(1.08); }
.avatar-choice.on { border-color: var(--primary); box-shadow: var(--shadow); }
.pub-head { display: flex; gap: .9rem; align-items: center; margin: .3rem 0 .6rem; }
.pub-head h1 { margin: 0; }
.pub-head p { margin: 0; }
.pub-albums { display: grid; grid-template-columns: 1fr; gap: .8rem; }
@media (min-width: 560px) { .pub-albums { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .pub-albums { grid-template-columns: repeat(3, 1fr); } }
.pub-album { display: flex; flex-direction: column; gap: .5rem; padding: .8rem .8rem .7rem; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.pub-album:hover { filter: brightness(1.06); }
.pub-album-name { font-weight: 700; text-align: center; }
.fan { position: relative; display: block; width: 100%; height: 128px; margin-top: .3rem; }
.fan img { position: absolute; bottom: 0; left: calc(50% + (var(--i) - (var(--n) - 1) / 2) * 30px); height: 112px; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 6px;
    background: var(--surface-2); box-shadow: 0 2px 8px rgba(0, 0, 0, .35); transform-origin: 50% 100%;
    transform: translateX(-50%) rotate(calc((var(--i) - (var(--n) - 1) / 2) * 9deg)); }
.counters { display: flex; gap: .9rem; justify-content: center; font-size: .85rem; color: var(--muted); }
.big-counters { font-size: 1rem; justify-content: flex-start; }
.album-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: .4rem 0 .6rem; }
.qr-box { display: grid; place-items: center; margin: .6rem 0; }
.qr-box svg { width: min(60vw, 240px); height: auto; background: #fff; border-radius: 10px; padding: .4rem; }
.visibility-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; margin: .3rem 0 .6rem; padding: .5rem .7rem; border-radius: var(--radius); background: var(--surface); }
.album-line { display: flex; gap: .5rem; align-items: stretch; margin-bottom: .6rem; }
.album-line .album-row { flex: 1; margin-bottom: 0; width: auto; }
.vis-toggle { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; min-width: 76px; padding: .4rem .5rem; border-radius: var(--radius);
    background: var(--surface); box-shadow: var(--shadow); font-size: .75rem; cursor: pointer; }
.vis-toggle.on { background: var(--ok-bg); color: var(--ok); }
.vis-toggle input { width: 20px; height: 20px; margin: 0; cursor: pointer; }

/* À vendre */
.price-input { display: inline-flex; align-items: center; gap: .3rem; }
.price-input input { width: 6.5rem; min-height: 40px; }
.listing-price { display: flex; flex-direction: column; gap: .2rem; margin: .5rem 0 .2rem; font-size: .85rem; color: var(--muted); }
.listing-note { margin: .2rem 0; font-size: .78rem; color: var(--muted); }
.listing-demand { margin: .3rem 0; font-size: .8rem; color: var(--ok); }
.listing-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .3rem 0; }
.picker-list { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .8rem; }
.picker-row { background: var(--surface-2); border-radius: 12px; padding: .5rem .6rem; border: 2px solid transparent; }
.picker-row.on { border-color: var(--primary); }
.picker-main { display: flex; gap: .6rem; align-items: center; cursor: pointer; }
.picker-main input[type=checkbox] { width: 22px; height: 22px; flex: none; }
.picker-main .item-img { width: 44px; flex: none; }
.picker-info { display: flex; flex-direction: column; min-width: 0; font-size: .85rem; }
.picker-edit { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin-top: .5rem; font-size: .85rem; color: var(--muted); }
.picker-edit input[type=number] { width: 5.5rem; min-height: 38px; }
@media (max-width: 480px) {
    .tab { font-size: .6rem; }
    .tab-ico { font-size: 1.2rem; }
}

/* Découvrir : tuiles, rail façon TikTok, intérêts */
.discover-head { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; }
.discover-head h1 { margin: 0; }
.chip-sep { flex: none; width: 1px; background: var(--border); margin: .2rem .3rem; }
.dgrid { display: grid; grid-template-columns: 1fr; gap: .9rem; margin-top: .8rem; }
@media (min-width: 640px) { .dgrid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .dgrid { grid-template-columns: repeat(3, 1fr); } }
.dtile { position: relative; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.dtile-main { display: flex; flex-direction: column; gap: .35rem; padding: .9rem 4rem .8rem .9rem; color: inherit; text-decoration: none; }
.dtile-main:hover { filter: brightness(1.05); }
.dtile-owner { display: flex; align-items: center; gap: .45rem; font-size: 1rem; }
.dtile-album { font-weight: 600; }
.dtile-meta { font-size: .78rem; color: var(--muted); }
.dtile .counters { justify-content: flex-start; font-size: .78rem; margin-top: .1rem; }
.dtile-more { display: inline-block; margin: 0 0 .7rem .9rem; font-size: .78rem; text-decoration: none; min-height: 32px; }
.fan-empty { position: absolute; inset: 0; display: grid; place-content: center; font-size: 2.4rem; opacity: .5; }
.dtile-rail { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: .8rem; align-items: center; }
.rail-col { display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.rail-col small { font-size: .68rem; color: var(--muted); }
.rail-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-content: center; font-size: 1.15rem; background: var(--surface-2); color: var(--text); cursor: pointer; }
.rail-btn.static { cursor: default; }
.rail-btn.on { background: var(--danger-bg); }
.rail-btn:hover:not(.static) { filter: brightness(1.15); }
.interest-hint { background: var(--surface); border-radius: var(--radius); padding: .6rem .8rem; font-size: .9rem; }
.interest-btn { margin-top: .4rem; width: 100%; }
.interest-sent { margin: .4rem 0 0; font-size: .8rem; color: var(--ok); }
.interest-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-h) + var(--safe-b)); z-index: 40; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between;
    padding: .7rem 1rem; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 14px rgba(0, 0, 0, .25); }
@media (min-width: 900px) { .interest-bar { left: 220px; bottom: 0; } }
.interest-check { display: block; font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.interest-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem; margin-bottom: .8rem; border: 2px solid transparent; }
.interest-card.match { border-color: var(--ok); }
.interest-head { display: flex; gap: .7rem; align-items: center; }
.interest-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.match-note { font-size: .85rem; color: var(--ok); }
.thumb-row { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .2rem; }
.thumb { flex: none; width: 52px; }
.thumb .item-img { width: 52px; }
a.topbar-user { display: inline-flex; align-items: center; gap: .45rem; color: inherit; text-decoration: none; }
/* Le profil passe par le blason de la barre du haut sur téléphone : une place de moins dans la barre du bas. */
.tab.tab-profile { display: none; }
@media (min-width: 900px) { .tab.tab-profile { display: flex; } }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.tab-ico svg { display: block; }
.btn svg { vertical-align: middle; margin-right: .4rem; }
.tab-ico { display: flex; align-items: center; justify-content: center; height: 1.6rem; }
@media (max-width: 420px) { .chip { padding: .4rem .7rem; font-size: .85rem; } .chips { gap: .4rem; } }

/* Mettre en vente : recherche en haut, liste qui défile seule, bouton toujours visible en bas */
.picker { display: flex; flex-direction: column; height: min(74vh, 640px); }
.picker-search { flex: none; margin-bottom: .5rem; }
.picker-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin-bottom: .6rem; padding-right: .2rem; }
.picker-footer { flex: none; padding-top: .5rem; border-top: 1px solid var(--border); background: var(--surface); }
.picker-footer .muted { margin: .4rem 0 0; font-size: .78rem; }

/* Scanner : numéro en trois cases (série, numéro, « / », total) et bouton de dictée */
.numform { display: grid; gap: .6rem; }
.numrow { display: flex; align-items: flex-end; gap: .4rem; }
.numrow .field { margin: 0; min-width: 0; }
.numrow .num-series { flex: 1.3 1 0; }
.numrow .num-number, .numrow .num-total { flex: 1 1 0; }
.numrow input { width: 100%; text-transform: uppercase; text-align: center; font-size: 1.15rem; }
.num-slash { font-size: 1.8rem; line-height: 2.6rem; color: var(--muted, #888); }
.btn.mic.on { background: var(--danger, #c0392b); color: #fff; animation: micpulse 1.1s ease-in-out infinite; }
@keyframes micpulse { 50% { opacity: .65; } }

/* Inviter un ami */
.invite-actions { display: grid; gap: .6rem; margin: .8rem 0; }
.invite-preview { margin: 0; padding: .8rem 1rem; background: var(--surface); border-left: 4px solid var(--accent, #4f46e5); border-radius: 8px; word-break: break-word; }

/* Drapeaux de langue du scanner : tous sur une seule ligne, même sur petit téléphone */
.flags-label { margin: .5rem 0 .25rem; }
.flags { display: flex; flex-wrap: nowrap; gap: 2px; margin-bottom: .75rem; }
.flag { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 0; border: 2px solid transparent; border-radius: 8px; background: transparent; cursor: pointer; font: inherit; color: inherit; }
.flag .flag-svg { width: 80%; max-width: 38px; height: auto; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.flag .flag-code { font-size: .6rem; font-weight: 700; opacity: .75; }
.flag.on { border-color: #3730a3; background: rgba(55,48,163,.12); }
.flag.on .flag-code { opacity: 1; }

/* Boutiques partenaires */
.shop-card { padding: .9rem 1rem; margin: .6rem 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); }
.shop-card.unlisted { opacity: .6; }
.shop-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.shop-head h3 { margin: 0; }
.shop-links { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 0; }
.shop-qr { margin-top: .6rem; text-align: center; }
.qr-svg { width: 220px; max-width: 70%; margin: 0 auto; }
.qr-svg svg { width: 100%; height: auto; }
.stats.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }

/* Formulaire boutique : code postal étroit, site internet large */
.shop-row > .postal-field { flex: 0 0 6.5rem; }
/* Champ piège anti-robots de la page /partenaires : hors écran, jamais visible ni atteignable au clavier. */
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.shop-row > .website-field { flex: 1 1 auto; }

/* Horaires : une ligne par jour (case, plage horaire) */
.hours-hint { margin: 0 0 .4rem; }
.hours-row { display: flex; align-items: center; gap: .5rem; margin: .3rem 0; }
.hours-row.off input[type=time] { opacity: .4; }
.hours-day { display: flex; align-items: center; gap: .5rem; flex: 0 0 8.2rem; color: var(--text); font-size: 1rem; }
.hours-day input { width: 22px; height: 22px; flex: none; }
.hours-row input[type=time] { flex: 1 1 0; min-width: 0; width: auto; padding: .5rem .5rem; }
.shop-fold { padding: 0; }
.shop-fold > :not(.shop-toggle) { margin-left: 1rem; margin-right: 1rem; }
.shop-fold > :last-child { margin-bottom: .9rem; }
.shop-toggle { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .8rem 1rem; background: none; border: 0; font: inherit; color: var(--text); text-align: left; cursor: pointer; min-height: 56px; }
.shop-title { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.shop-title b { font-size: 1.05rem; }
.shop-chevron { flex: none; color: var(--muted); font-size: .8rem; }
.thumb-zoom { flex: none; padding: 0; border: 0; background: none; cursor: zoom-in; display: block; }
.zoom-overlay { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(8, 8, 24, .92); cursor: zoom-out; }
.zoom-overlay img { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 4.5% / 3.2%; box-shadow: 0 8px 30px rgba(0,0,0,.6); }
.progress-card { margin: 1rem 0; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.progress-card h2 { margin: 0 0 .6rem; }
.progress-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .6rem; }
.badge-row { display: inline-flex; gap: 2px; align-items: center; vertical-align: middle; }
.badge-sparkle { animation: badge-twinkle 1.6s ease-in-out infinite; filter: drop-shadow(0 0 3px rgba(255, 255, 255, .9)); }
@keyframes badge-twinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .6; transform: scale(1.12); } }
.gauge { position: relative; display: block; width: 100%; height: 2.4rem; padding: 0; border: 2px solid var(--primary); border-radius: 999px; background: var(--surface-2); overflow: hidden; font: inherit; color: var(--text); }
.gauge-fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #22c55e, #86efac); transition: width .6s ease; }
.gauge-text { position: relative; display: flex; align-items: center; justify-content: center; height: 100%; font-weight: 800; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000, 0 1px 2px #000; }
button.gauge.full { cursor: pointer; animation: gauge-pulse 1.4s ease-in-out infinite; }
button.gauge.full .gauge-fill { background: linear-gradient(90deg, #f59e0b, #fde68a); }

@keyframes gauge-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .6); } 50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); } }
.progress-next { margin: .5rem 0 0; }
.progress-help { margin-top: .6rem; font-size: .92rem; }
.progress-help ul { margin: .4rem 0; padding-left: 1.2rem; }
@media (prefers-reduced-motion: reduce) { .badge-sparkle, button.gauge.full { animation: none; } .gauge-fill { transition: none; } }
.shop-suggest { text-align: center; }
.suggest-qr { display: block; margin: .6rem auto; padding: .4rem; background: #fff; border-radius: 12px; width: min(60vw, 200px); height: auto; }
.shop-hours { margin: .4rem 0; }
.hours-line { display: flex; justify-content: space-between; max-width: 16rem; padding: .15rem 0; font-size: 1rem; color: var(--text); border-bottom: 1px solid var(--border); }
.hours-line span:last-child { font-weight: 600; }
.hours-line .closed { color: var(--muted); font-weight: 400; }

/* Liste compacte des boutiques déjà inscrites (code postal, nom) */
.shop-index { list-style: none; margin: 0; padding: 0; }
.shop-index li { display: flex; gap: .8rem; padding: .25rem 0; border-bottom: 1px solid var(--border); }
.shop-index li.unlisted { opacity: .6; }
.shop-pc { flex: 0 0 3.6rem; font-variant-numeric: tabular-nums; font-weight: 700; }

/* Paquets de gemmes (page Recharger) */
.packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; margin: .5rem 0; }
.pack { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .8rem .5rem; border: 2px solid #3730a3; border-radius: 12px; background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.pack b { font-size: 1.25rem; }
.pack-bonus { font-size: .8rem; font-weight: 700; color: #15803d; }
.pack-price { margin-top: .2rem; padding: .15rem .7rem; border-radius: 999px; background: #3730a3; color: #fff; font-weight: 700; }
.pack:disabled { opacity: .6; cursor: default; }

.pill.boost { background: #fbbf24; color: #3b2a00; font-weight: 700; }
.boost-options { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.boost-options .listing-note, .boost-options .alert { flex-basis: 100%; }
.gem-card { border: 1px solid rgba(55,48,163,.35); border-radius: 12px; padding: .75rem 1rem; margin: 1rem 0; background: rgba(55,48,163,.06); }
.gem-card b.big { font-size: 1.3rem; }
.option-card { border: 1px solid rgba(128,128,128,.3); border-radius: 12px; padding: .75rem 1rem; margin: .75rem 0; }
.option-card h3 { margin: 0 0 .25rem; font-size: 1.05rem; }

/* Flyer boutique, A5 paysage (21 x 14,8 cm) : QR code à gauche, texte à droite. Couleurs fixes (identique en thème sombre et à l'impression).
   Sur un écran étroit (téléphone), les deux colonnes s'empilent pour l'aperçu. */
.flyer { box-sizing: border-box; width: min(100%, 21cm); margin: 1rem auto; background: #fff; color: #1b1a2e; border-radius: 12px; overflow: hidden;
    box-shadow: 0 2px 14px rgba(0,0,0,.25); -webkit-print-color-adjust: exact; print-color-adjust: exact; display: flex; flex-direction: column; }
.flyer-band { background: #3730a3; color: #fff; padding: .6rem 1rem; font-size: 1.15rem; font-weight: 800; letter-spacing: .03em; text-align: center; }
.flyer-logo { width: 2rem; height: 2rem; vertical-align: middle; margin-right: .4rem; border-radius: 8px; }
.flyer-band .gem-icon { vertical-align: middle; margin-left: .4rem; }
.flyer-foot .gem-icon { vertical-align: -4px; }
.flyer-body { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 1rem 1.2rem 1.2rem; }
.flyer-qr { flex: none; text-align: center; width: min(70%, 7cm); }
.flyer-qr-svg { padding: .4rem; background: #fff; border: 3px solid #3730a3; border-radius: 16px; }
.flyer-qr-svg svg { display: block; width: 100%; height: auto; }
.flyer-scan { margin: .6rem 0 0; font-size: 1.3rem; font-weight: 800; color: #3730a3; }
.flyer-from { margin: .1rem 0 0; font-size: 1rem; color: #1b1a2e; }
.flyer-text { flex: 1; min-width: 0; text-align: left; }
.flyer-title { margin: 0 0 .3rem; font-size: 1.8rem; line-height: 1.1; color: #1b1a2e; }
.flyer-lead { margin: 0 0 .8rem; font-size: 1.05rem; color: #4338ca; font-weight: 600; }
.flyer-points { list-style: none; margin: 0 0 .8rem; padding: 0; }
.flyer-points li { display: flex; gap: .7rem; align-items: center; margin: .5rem 0; font-size: 1rem; line-height: 1.3; }
.flyer-points li > span { flex: none; width: 2.6rem; text-align: center; font-size: 1.8rem; }
.flyer-points li > span.flyer-ico { display: flex; align-items: center; justify-content: center; color: #3730a3; }
.flyer-foot { margin: 0; font-size: .9rem; color: #4b4a68; }
.flyer-foot span { font-size: .78rem; word-break: break-all; }
@media (min-width: 640px), print {
    .flyer-body { flex-direction: row; align-items: center; gap: 1.4rem; }
    .flyer-qr { width: 7cm; }
}
@media print {
    @page { size: A5 landscape; margin: 0; }
    .topbar, .tabs, .no-print, .toast { display: none !important; }
    body, .shell, .content { background: #fff !important; padding: 0 !important; margin: 0 !important; max-width: none !important; }
    .shell { display: block !important; }
    .flyer { width: 100%; height: 100vh; margin: 0; border-radius: 0; box-shadow: none; }
}

/* Console d'administration (PC) */
.page.admin-wide { max-width: 1100px; margin: 0 auto; }
.admin-lock { max-width: 420px; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 1rem; }
.admin-tab { border: 1px solid var(--border, #8884); background: var(--surface); color: inherit; border-radius: 10px; padding: .5rem .9rem; font: inherit; cursor: pointer; }
.admin-tab.active { background: var(--surface-2); color: var(--primary); font-weight: 700; }
.admin-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.admin-table th, .admin-table td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid #8883; vertical-align: middle; }
.admin-table tr.unlisted td { opacity: .6; }
.admin-actions { white-space: nowrap; }
.gift-input { width: 5rem; }
.service-row { display: flex; gap: .75rem; align-items: flex-start; padding: .55rem 0; border-bottom: 1px solid #8883; }
.service-row:last-child { border-bottom: 0; }
.service-dot { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; margin-top: .3rem; background: #2eb872; }
.service-dot.lvl1 { background: #f0a020; }
.service-dot.lvl2 { background: #e03c3c; }

/* Carte de visite 85 x 55 mm (couleurs fixes, identique en thème sombre et à l'impression) */
.only-print { display: none; }
.bc-tools { max-width: 900px; margin: 0 auto; padding: 1rem; }
.bc-preview { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.bc { box-sizing: border-box; width: 85mm; height: 55mm; overflow: hidden; border-radius: 3mm; color: #1b1a2e; background: #fff;
      box-shadow: 0 2px 10px #0003; font-family: system-ui, "Segoe UI", sans-serif; position: relative; }
.bc-front { background: radial-gradient(circle at 50% 40%, #4f46e5 0%, #2b2680 45%, #0f0d2e 100%); color: #fff; padding: 2mm 3mm 2mm; display: flex; flex-direction: column; align-items: center; justify-content: center; }
/* Titre CARDS / & / FREAKS comme l'écran d'accueil : lettres remplies par des cartes, contour bleu clair */
.bcl-line { display: flex; justify-content: center; font-family: Impact, "Arial Black", system-ui, sans-serif; font-weight: 900; font-size: 50pt; line-height: .93; letter-spacing: .02em; }
.bcl-line.amp { font-size: 24pt; line-height: .85; }
.bcl { position: relative; display: inline-block; color: transparent; }
.bcl::before, .bcl::after { content: attr(data-ch); position: absolute; inset: 0; }
.bcl::before { color: transparent; -webkit-text-stroke: .5mm #a5f3fc; }
.bcl::after { background: var(--img) 50% 30% / cover; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.bc-tag { margin: 1mm 0 0; text-align: center; font-size: 6.8pt; line-height: 1.2; color: #c7d2fe; }
.bc-back { display: flex; gap: 4mm; padding: 4mm 5mm; align-items: center; }
.bc-qr { flex: none; width: 31mm; text-align: center; }
.bc-qr img { display: block; width: 31mm; height: 31mm; border: 1.2mm solid #3730a3; border-radius: 3mm; padding: .5mm; box-sizing: border-box; }
.bc-qr span { display: block; margin-top: 1.5mm; font-size: 9pt; font-weight: 800; color: #3730a3; }
.bc-info { flex: 1; min-width: 0; }
.bc-title { margin: 0; font-size: 10.5pt; font-weight: 800; color: #1b1a2e; }
.bc-gems { margin: .5mm 0 1.5mm; font-size: 7.5pt; color: #4338ca; font-weight: 700; }
.bc-gems .gem-icon { vertical-align: -2px; }
.bc-info ul { list-style: none; margin: 0 0 1.5mm; padding: 0; font-size: 7pt; line-height: 1.5; color: #1b1a2e; }
.bc-info li svg { vertical-align: -2px; color: #3730a3; }
.bc-url { margin: 0; font-size: 8.5pt; font-weight: 800; color: #3730a3; }
@media print {
    @page cards { size: A4 portrait; margin: 0; }
    .only-print { display: grid; }
    .bc-sheet { page: cards; grid-template-columns: repeat(2, 85mm); grid-auto-rows: 55mm; justify-content: center; align-content: center;
                width: 210mm; height: 297mm; break-after: page; page-break-after: always; }
    .bc-sheet:last-of-type { break-after: auto; page-break-after: auto; }
    .bc { box-shadow: none; border-radius: 0; outline: .1mm solid #ccc; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Pages juridiques (/conditions, /confidentialite) et cases d'acceptation */
.page.legal { max-width: 820px; margin: 0 auto; line-height: 1.6; }
.page.legal h2 { margin-top: 2rem; scroll-margin-top: 1rem; }
.page.legal h3 { margin-top: 1.4rem; font-size: 1.05rem; }
.page.legal ul { padding-left: 1.2rem; }
.legal-toc { margin: 1rem 0; }
.table-wrap { overflow-x: auto; }
.legal-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.legal-table th, .legal-table td { border: 1px solid var(--border, #ddd); padding: .5rem .6rem; text-align: left; vertical-align: top; }
.legal-links { text-align: center; font-size: .85rem; color: var(--muted); margin: .8rem 0 0; }
.accept-box { display: flex; gap: .6rem; align-items: flex-start; margin: .8rem 0; font-size: .92rem; line-height: 1.45; cursor: pointer; }
.accept-box input { margin-top: .2rem; flex: none; width: 1.1rem; height: 1.1rem; }
.age-choice { border: 0; padding: 0; margin: .8rem 0 0; }
.age-choice legend { font-size: .9rem; color: var(--muted); padding: 0; }
.age-choice .accept-box { margin: .3rem 0; }
.meeting-notice { background: var(--surface-2, rgba(127,127,127,.12)); border-radius: .6rem; padding: .5rem .8rem; margin: .5rem 0; font-size: .9rem; }
.meeting-notice p { margin: .3rem 0; }

/* ---------- Univers : interrupteur (page Collection), pastille (autres pages), badges ---------- */
.game-switch { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; max-width: 560px; margin: 0 0 1rem; }
.game-tile { border: 2px solid transparent; border-radius: 18px; padding: .7rem .5rem; cursor: pointer; opacity: .72; transition: opacity .15s, border-color .15s;
    color: #fff; text-align: center; min-height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; font: inherit; }
.game-tile[data-g="pokemon"] { background: #494458; }
.game-tile[data-g="magic"] { background: #1c1b20; border-color: #3a3945; }
.game-tile img { width: min(170px, 72%); height: auto; display: block; }
.game-tile small { font-size: .8rem; opacity: .85; }
.game-tile.on { opacity: 1; border-color: #f5c518; box-shadow: 0 0 0 3px rgba(245, 197, 24, .28); }
.game-tile[data-g="magic"].on { border-color: #22d3ee; box-shadow: 0 0 0 3px rgba(34, 211, 238, .28); }
.game-tile:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.game-chip { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; margin: 0 0 .6rem; }
.game-chip button { border: 0; background: none; color: var(--muted); padding: .3rem .9rem; border-radius: 999px; font: inherit; font-size: .88rem; cursor: pointer; min-height: 34px; }
.game-chip button.on { background: var(--primary); color: var(--primary-text); font-weight: 700; }

.game-badge { font-size: .7rem; font-weight: 800; padding: .05rem .45rem; border-radius: 6px; margin-left: .3rem; vertical-align: middle; }
.game-badge[data-g="pokemon"] { background: #facc15; color: #1b1a2e; }
.game-badge[data-g="magic"] { background: #22d3ee; color: #06222a; }
.tag.foil { background: linear-gradient(90deg, #f0abfc, #67e8f9); color: #10172e; font-weight: 700; }

/* ---------- Univers Magic : thème sombre bleu nuit, accent cyan. L'en-tête garde le violet de la marque. ---------- */
:root[data-game="magic"] {
    --bg: #0c1226; --surface: #141b33; --surface-2: #1b2442; --text: #e8ecf8; --muted: #8a94b3; --border: #222c4a;
    --primary: #22d3ee; --primary-text: #06222a;
    --ok: #4ade80; --danger: #fca5a5; --danger-bg: #4c1d1d; --ok-bg: #14391f; --warn: #fcd34d; --warn-bg: #4a3512;
    --shadow: 0 1px 2px rgba(0, 0, 0, .45);
    color-scheme: dark;
}
:root[data-game="magic"] .topbar { background: #3730a3; color: #fff; }

/* ---------- Fiche d'une carte Magic ---------- */
.card-detail .detail-grid { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 1.5rem; align-items: start; }
.detail-frame { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 1.25rem; display: grid; place-items: center; }
.detail-frame .card-picture { width: 100%; display: block; }
.detail-frame .card-picture img { width: 100%; max-width: 300px; margin: 0 auto; border-radius: 14px; }
.detail-noimg { font-size: 3rem; font-weight: 800; color: var(--muted); padding: 3rem 0; }
.detail-info h1 { font-size: 1.7rem; margin: 0; }
.detail-sub { color: var(--muted); margin: .15rem 0 .8rem; }
.detail-pills { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; margin: .5rem 0; }
.detail-line { margin: .4rem 0; }
.pill-line { border: 1px solid var(--border); border-radius: 999px; padding: .15rem .75rem; font-size: .9rem; }
.rarity { background: rgba(168, 85, 247, .18); color: #c4a1ff; border-radius: 10px; padding: .15rem .7rem; font-size: .9rem; font-weight: 600; }
.rarity-common { background: var(--surface-2); color: var(--muted); }
.rarity-rare { background: rgba(250, 204, 21, .16); color: #e9c43a; }
.format { background: rgba(16, 185, 129, .15); color: #3ec99a; border-radius: 999px; padding: .1rem .7rem; font-size: .82rem; }
.detail-actions { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1rem; margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.detail-actions p { flex: 1 0 100%; margin: 0 0 .3rem; }
.detail-legal { margin-top: 1rem; font-size: .75rem; color: var(--muted); }
.mana { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: .7rem; font-weight: 800; color: #10172e; background: #cbc6c1; margin-right: 2px; }
.mana-w { background: #f6f3d4; } .mana-u { background: #7dd3fc; } .mana-b { background: #a69aa3; } .mana-r { background: #f87171; } .mana-g { background: #86efac; }
@media (max-width: 700px) { .card-detail .detail-grid { grid-template-columns: 1fr; } }
