/* ==========================================================================
   MOTORAUTO — Jouer : cartes, échanges, défis, concours, caractéristiques, admin jeu
   ========================================================================== */
.sec-title { margin: 1.4rem 0 .7rem; font-size: 1rem; font-weight: 800; display: flex; align-items: center; gap: .5rem; }
.sec-title.nomargin, .nomargin { margin: 0; }
.sec-lead { color: var(--color-secondary); font-size: .9rem; line-height: 1.55; margin: 0 0 1rem; }
.count-pill { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 .4rem; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: .72rem; font-weight: 800; }
.mt { margin-top: .8rem; }
.tcg-alert { padding: .7rem .9rem; border-radius: var(--corner-sm); background: color-mix(in srgb, #ef4444 14%, var(--bg-surface)); border: 1px solid color-mix(in srgb, #ef4444 40%, transparent); font-size: .88rem; margin-bottom: 1rem; }
.xp-bar { height: 8px; border-radius: 99px; background: var(--bg-elevated); overflow: hidden; }
.xp-bar.small { height: 5px; }
.xp-bar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #fbbf24)); transition: width .7s var(--ease-out); }

/* ---- squelette de chargement ---- */
.tcg-skeleton { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; }
.tcg-skeleton > i { display: block; height: 120px; border-radius: var(--corner-md); background: linear-gradient(100deg, var(--bg-surface) 30%, var(--bg-elevated) 50%, var(--bg-surface) 70%); background-size: 250% 100%; animation: sk 1.3s linear infinite; }
@keyframes sk { to { background-position: -150% 0; } }

/* ---- hub Jouer ---- */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .9rem; }
.hub-tile { position: relative; display: grid; gap: .25rem; align-content: start; padding: 1.2rem; border-radius: var(--corner-md); background: var(--bg-surface); border: 1px solid var(--stroke-line); color: inherit; text-decoration: none; transition: transform .25s var(--ease-out), border-color .2s, box-shadow .25s; }
.hub-tile:hover, .hub-tile:focus-visible { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 16px 30px -18px var(--glow); }
.hub-tile.big { grid-column: 1 / -1; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, var(--bg-surface)), var(--bg-surface)); }
.hub-ico { font-style: normal; font-size: 1.8rem; line-height: 1; }
.hub-tile b { font-size: 1.02rem; }
.hub-tile small { color: var(--color-muted); font-size: .82rem; line-height: 1.4; }
.hub-badge { position: absolute; top: .8rem; right: .8rem; padding: .15rem .55rem; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: .7rem; font-weight: 800; }

/* ---- cartes ---- */
.tcg-hero { display: grid; gap: 1rem; margin-bottom: 1rem; padding: 1rem; border-radius: var(--corner-md); background: var(--bg-surface); border: 1px solid var(--stroke-line); }
.tcg-packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .7rem; }
.tcg-pack { min-height: 92px; transition: transform .2s var(--ease-out), box-shadow .2s; }
.tcg-pack.ready:hover { transform: translateY(-2px); }
.tcg-pack:disabled { cursor: wait; opacity: .7; }
.tcg-dust { padding: .8rem 1rem; border-radius: 14px; background: var(--bg-elevated); }
.tcg-sec { grid-column: 1 / -1; margin-top: .6rem; font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--color-muted); }
.tcg-tools { grid-template-columns: 1fr; }
.tcg-tools input { min-height: 44px; font-size: 16px; }
.chip-row { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chip-row::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 36px; padding: 0 .85rem; border-radius: 99px; border: 1px solid var(--stroke-line); background: var(--bg-surface); color: var(--color-secondary); font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.chip:hover { border-color: var(--accent); }
.chip.on, .chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tcg { transition: transform .25s var(--ease-out), box-shadow .25s; will-change: transform; }
.tcg-name { overflow-wrap: anywhere; }
.tcg-note { font-size: .72rem; color: var(--color-muted); line-height: 1.35; margin-top: .25rem; }
.tcg-wish { position: absolute; bottom: .4rem; left: .4rem; color: #fbbf24; font-size: .9rem; text-shadow: 0 1px 3px #000; }
.tcg-empty { grid-column: 1 / -1; }
.tcg-c-gold { --rc: #f59e0b; } .tcg-c-ice { --rc: #38bdf8; } .tcg-c-rose { --rc: #f472b6; } .tcg-c-emerald { --rc: #10b981; } .tcg-c-violet { --rc: #8b5cf6; }
.tcg-special, .tcg[class*="tcg-c-"] { box-shadow: 0 0 24px color-mix(in srgb, var(--rc) 45%, transparent); }
@keyframes foil { to { background-position: -150% 0; } }
.tcg-mini { width: 96px; flex: none; }
.tcg-mini .tcg-body { padding: .35rem .45rem .45rem; } .tcg-mini .tcg-stats, .tcg-mini .tcg-note { display: none; }
.tcg-overlay { overscroll-behavior: contain; animation: ovin .25s var(--ease-out); }
@keyframes ovin { from { opacity: 0; } }
.tcg-stage { width: min(100%, 900px); padding: 1rem 0 2rem; }
.tcg-big { width: min(240px, 62vw); }
.tcg-hint { color: rgba(255,255,255,.75); font-size: .85rem; }
.flip-in { will-change: transform; }
.pk-logo { font-weight: 900; letter-spacing: .08em; }
.wish-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.wish-chip { display: inline-flex; align-items: center; padding: .25rem .65rem; border-radius: 99px; background: var(--bg-elevated); border: 1px solid var(--stroke-line); font-size: .78rem; }
.wish-chip.match { border-color: #10b981; color: #10b981; }

/* ---- échanges ---- */
.trade-list { display: grid; gap: .8rem; }
.trade-list.compact .trade-row { opacity: .75; }
.trade-row { padding: 1rem; border-radius: var(--corner-md); background: var(--bg-surface); border: 1px solid var(--stroke-line); display: grid; gap: .8rem; }
.trade-head { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.trade-st { padding: .15rem .6rem; border-radius: 99px; font-size: .72rem; font-weight: 800; background: var(--bg-elevated); }
.trade-st.pending { color: #f59e0b; } .trade-st.accepted { color: #10b981; } .trade-st.declined, .trade-st.cancelled { color: var(--color-muted); }
.trade-swap { display: grid; grid-template-columns: 1fr auto 1fr; gap: .6rem; align-items: center; justify-items: center; text-align: center; }
.trade-swap small { display: block; margin-bottom: .3rem; color: var(--color-muted); font-size: .75rem; }
.trade-swap > i { font-style: normal; font-size: 1.4rem; color: var(--accent); }
.trade-msg { font-style: italic; color: var(--color-secondary); font-size: .88rem; }
.trade-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.pilot-trades { display: grid; gap: .6rem; }
.pilot-trade { border-radius: var(--corner-md); background: var(--bg-surface); border: 1px solid var(--stroke-line); overflow: hidden; }
.pilot-trade.open { border-color: var(--accent); }
.pt-head { display: flex; align-items: center; gap: .8rem; width: 100%; padding: .8rem 1rem; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; min-height: 56px; }
.pt-main { display: grid; gap: .15rem; flex: 1; min-width: 0; } .pt-main small { color: var(--color-muted); }
.pt-go { color: var(--accent); font-weight: 800; flex: none; }
.match-tag { display: inline-block; margin-right: .3rem; padding: .1rem .5rem; border-radius: 99px; background: color-mix(in srgb, #f59e0b 16%, transparent); color: #f59e0b; font-size: .7rem; font-weight: 700; }
.match-tag.me { background: color-mix(in srgb, #10b981 16%, transparent); color: #10b981; }
.trade-composer { display: grid; gap: 1rem; padding: 0 1rem 1rem; }
.comp-col h4 { font-size: .85rem; margin-bottom: .5rem; } .comp-col h4 small { color: var(--color-muted); font-weight: 500; }
.pick-row { display: flex; gap: .6rem; overflow-x: auto; padding: 4px 2px 8px; scroll-snap-type: x proximity; }
.pick { flex: none; padding: 3px; border-radius: 16px; border: 2px solid transparent; background: none; cursor: pointer; scroll-snap-align: start; transition: border-color .2s, transform .2s; }
.pick.on { border-color: var(--accent); transform: translateY(-2px); }
.comp-send { display: grid; gap: .6rem; }
.comp-send input { min-height: 44px; padding: 0 .8rem; border-radius: 10px; border: 1px solid var(--stroke-line); background: var(--bg-elevated); color: inherit; font: inherit; font-size: 16px; }
@media (min-width: 700px) { .trade-composer { grid-template-columns: 1fr 1fr; } .comp-send { grid-column: 1 / -1; grid-template-columns: 1fr auto; } }

/* ---- défis ---- */
.chal-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .7rem; }
.chal-score { font-size: 1.6rem; font-weight: 900; color: var(--color-muted); } .chal-score b { color: var(--accent); font-size: 2rem; }
.chal-list { display: grid; gap: .7rem; margin: 1rem 0; }
.chal { display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; align-items: center; padding: .9rem 1rem; border-radius: var(--corner-md); background: var(--bg-surface); border: 1px solid var(--stroke-line); transition: border-color .2s, background .2s; }
.chal.ready { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg-surface)); }
.chal.claimed { opacity: .65; }
.chal-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--bg-elevated); font-size: 1.4rem; }
.chal-main { display: grid; gap: .35rem; min-width: 0; } .chal-main small { color: var(--color-muted); font-size: .78rem; }
.chal-done { color: #10b981; font-weight: 800; font-size: .85rem; white-space: nowrap; }
@media (max-width: 520px) { .chal { grid-template-columns: auto 1fr; } .chal > :last-child { grid-column: 1 / -1; justify-self: stretch; text-align: center; } }

/* ---- concours ---- */
.contest-hero { padding: 1.4rem; border-radius: var(--corner-md); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 20%, var(--bg-surface)), var(--bg-surface)); border: 1px solid var(--stroke-line); display: grid; gap: .5rem; }
.contest-hero h3 { font-size: 1.4rem; line-height: 1.2; }
.contest-hero.off { background: var(--bg-surface); }
.contest-kicker { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.contest-prize { font-size: .88rem; color: var(--color-secondary); }
.contest-box { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: 1rem; padding: 1rem; border-radius: var(--corner-md); background: var(--bg-surface); border: 1px dashed var(--stroke-line); }
.contest-box > span { flex: 1 1 220px; }
.contest-box.pending { border-color: #f59e0b; } .contest-box.approved { border-color: #10b981; border-style: solid; } .contest-box.rejected { border-color: #ef4444; }
.contest-form { display: grid; gap: .8rem; border-style: solid; }
.contest-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.contest-thumb { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; }
.contest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.photo-card { border-radius: var(--corner-md); overflow: hidden; background: var(--bg-surface); border: 1px solid var(--stroke-line); display: grid; transition: transform .25s var(--ease-out), border-color .2s; }
.photo-card:hover { transform: translateY(-3px); } .photo-card.voted { border-color: var(--accent); }
.photo-open { position: relative; display: block; padding: 0; border: 0; background: var(--bg-elevated); cursor: zoom-in; aspect-ratio: 4/3; overflow: hidden; width: 100%; }
.photo-open img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: .5rem .7rem; background: linear-gradient(transparent, rgba(0,0,0,.75)); color: #fff; font-size: .78rem; text-align: left; }
.photo-meta { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .7rem .9rem; }
.photo-meta div { min-width: 0; display: grid; } .photo-meta a { color: inherit; text-decoration: none; } .photo-meta small { color: var(--color-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vote-btn, .vote-pill { display: inline-flex; align-items: center; gap: .3rem; min-height: 40px; padding: 0 .9rem; border-radius: 99px; border: 1px solid var(--stroke-line); background: var(--bg-elevated); color: var(--color-secondary); font: inherit; font-weight: 700; flex: none; }
.vote-btn { cursor: pointer; transition: transform .2s var(--ease-spring), background .2s, color .2s; }
.vote-btn:active { transform: scale(.92); }
.vote-btn.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.vote-pill.own { color: var(--accent); }
.hall { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.hall-card { display: grid; gap: .5rem; padding: .9rem; border-radius: var(--corner-md); background: var(--bg-surface); border: 1px solid var(--stroke-line); }
.hall-card .photo-open { border-radius: 12px; }
.lightbox { position: fixed; inset: 0; z-index: 3100; display: grid; place-items: center; align-content: center; gap: .6rem; padding: 1rem; background: rgba(0,0,0,.9); color: #fff; animation: ovin .2s; }
.lightbox img { max-width: min(96vw, 1200px); max-height: 80vh; border-radius: 12px; object-fit: contain; }
.lightbox-x { position: absolute; top: calc(.8rem + var(--safe-top)); right: .8rem; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 1.6rem; cursor: pointer; }

/* ---- caractéristiques ---- */
.stats-box { width: min(560px, 100%); }
.stats-lvl { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.stats-sec h3 { margin: 1.1rem 0 .5rem; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--color-muted); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .6rem; }
.stat-tile { display: grid; gap: .1rem; padding: .75rem; border-radius: 12px; background: var(--bg-elevated); border: 1px solid var(--stroke-line); }
.stat-tile b { font-size: 1.35rem; font-variant-numeric: tabular-nums; } .stat-tile span { font-size: .78rem; color: var(--color-secondary); } .stat-tile small { font-size: .7rem; color: var(--color-muted); }
.stats-foot { margin-top: 1.2rem; text-align: center; }

/* ---- profil public : collection + échanges ---- */
.pub-cards-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }

/* ---- suivi garage ---- */
.follow-sections { display: grid; gap: 1.5rem; }
.follow-block { display: grid; gap: .8rem; }

/* ---- admin jeu ---- */
.admin-sec-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.admin-sep { border: 0; border-top: 1px solid var(--stroke-line); margin: 1.6rem 0; }
.admin-card-form { display: grid; gap: 1rem; padding: 1rem; margin: .8rem 0; border-radius: var(--corner-md); background: var(--bg-surface); border: 1px solid var(--accent); }
.acf-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; }
.acf-fields .wide, .admin-card-form .wide { grid-column: 1 / -1; }
.acf-preview { display: grid; justify-items: center; gap: .4rem; } .acf-preview .tcg { width: 190px; }
.acf-actions, .grant-actions, .acr-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.inline-field { display: flex; gap: .5rem; align-items: center; } .inline-field input[type=text] { flex: 1; min-width: 0; }
.admin-cards { display: grid; gap: .8rem; margin-top: .8rem; }
.admin-card-row { display: grid; grid-template-columns: 120px 1fr; gap: 1rem; padding: .9rem; border-radius: var(--corner-md); background: var(--bg-surface); border: 1px solid var(--stroke-line); }
.admin-card-row.off { opacity: .6; } .acr-card .tcg { width: 120px; } .acr-main { display: grid; gap: .45rem; align-content: start; min-width: 0; } .acr-main small { color: var(--color-muted); }
.grant-form { display: grid; grid-template-columns: 2fr 1fr; gap: .7rem; padding: .8rem; border-radius: 12px; background: var(--bg-elevated); }
.grant-actions, .grant-form .form-error { grid-column: 1 / -1; }
.contest-admin { display: grid; gap: .7rem; }
.admin-entries { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .8rem; }
.admin-entry { display: grid; grid-template-columns: 96px 1fr; gap: .8rem; padding: .7rem; border-radius: 12px; background: var(--bg-surface); border: 1px solid var(--stroke-line); }
.admin-entry img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; display: block; } .admin-entry div { display: grid; gap: .4rem; min-width: 0; } .admin-entry small { color: var(--color-muted); }
@media (max-width: 560px) { .admin-card-row { grid-template-columns: 1fr; justify-items: center; } .acr-main { justify-items: center; text-align: center; } .grant-form { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .tcg-skeleton > i, .tcg[class*="tcg-c-"] .tcg-foil, .tcg-overlay, .lightbox { animation: none; }
  .xp-bar > i, .hub-tile, .photo-card, .tcg, .vote-btn { transition: none; }
}

/* pack prêt : halo pulsé (pas de déplacement → clic stable, aucune saccade) */
.tcg-pack.ready { animation: packpulse 2.4s ease-in-out infinite; }
@keyframes packpulse { 50% { box-shadow: 0 10px 34px color-mix(in srgb, var(--accent) 65%, transparent); } }

/* filtres de la collection : recherche + rareté sur une ligne, champs homogènes */
.tcg-tools select { width: 100%; min-height: 44px; padding: 0 2.2rem 0 .85rem; border-radius: 10px; border: 1px solid var(--stroke-line); background-color: var(--bg-surface); color: inherit; font: inherit; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--color-muted) 50%), linear-gradient(135deg, var(--color-muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.tcg-tools select:focus-visible, .tcg-tools input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (min-width: 700px) { .tcg-tools { grid-template-columns: 1fr 220px; } .tcg-tools .chip-row, .tcg-tools > :nth-child(n+3) { grid-column: 1 / -1; } }
.hub-ico-svg { display: inline-grid; place-items: center; width: 34px; height: 34px; }
.hub-ico-svg svg { display: block; }
