/* =========================================================
   PTJ — Platine ton jeux
   Base neutre, inspirée des interfaces console. Chaque jeu
   surcharge ces variables dans css/themes/<jeu>.css.
   ========================================================= */
:root {
  --bg: #05070d;
  --panel: #12151e;
  --panel2: #1b1f2a;
  --line: #1f2330;
  --text: #ffffff;
  --soft: #d7dce6;
  --muted: #aeb5c2;
  --dim: #8a92a1;
  --link: #6cb4ff;
  --glass: rgba(255, 255, 255, .12);
  --danger: #ff5c7a;
  --danger-bg: #2a1018;
  --ok: #ffffff;

  --plat: #9cc9f5;
  --gold: #e8b64c;
  --silver: #c3c9d3;
  --bronze: #c98a5b;
  --tile-P: #1c2a3d;
  --tile-G: #3a2c12;
  --tile-S: #2a2d33;
  --tile-B: #33221a;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.5; min-height: 100vh; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
svg.lucide { width: 20px; height: 20px; flex: none; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 760px) { .wrap { padding: 0 32px; } }

.cup-P { color: var(--plat); } .cup-G { color: var(--gold); } .cup-S { color: var(--silver); } .cup-B { color: var(--bronze); }

/* ---------- En-tête ---------- */
.topbar { position: absolute; left: 0; right: 0; top: 0; z-index: 20; }
.topbar .wrap { height: 76px; display: flex; align-items: center; gap: 32px; }
.logo { text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: -.3px; }
.nav { display: flex; gap: 6px; }
.nav a { text-decoration: none; padding: 8px 16px; border-radius: 99px; color: var(--soft); font-size: 15px; font-weight: 500; }
.nav a:hover { background: var(--glass); }
.nav a[aria-current="page"] { background: #fff; color: #05070d; }
.top-actions { margin-left: auto; display: flex; gap: 12px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--glass); display: grid; place-items: center; text-decoration: none; }
.icon-btn:hover { background: rgba(255,255,255,.2); }
@media (max-width: 640px) { .nav { display: none; } }

/* ---------- Bannière ---------- */
.banner { position: relative; overflow: hidden; min-height: 560px; display: flex; align-items: flex-end; }
.banner-img { position: absolute; inset: 0; background-size: cover; background-position: center; }
.banner::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--bg) 92%, transparent) 0%, color-mix(in srgb, var(--bg) 50%, transparent) 45%, transparent 75%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 55%, transparent) 0%, transparent 22%, transparent 55%, var(--bg) 100%);
}
.banner .wrap { position: relative; z-index: 1; width: 100%; padding-top: 140px; padding-bottom: 40px; display: grid; gap: 16px; }
.banner h1 { margin: 0; font-weight: 300; font-size: clamp(40px, 6vw, 72px); line-height: 1.02; letter-spacing: -1.5px; max-width: 720px; }
.banner h1.logo-title { line-height: 0; }
.banner h1.logo-title img { width: clamp(200px, 26vw, 340px); height: auto; filter: drop-shadow(0 8px 24px rgba(0,0,0,.5)); }
.banner p { margin: 0; font-size: 18px; color: var(--soft); max-width: 480px; }
.badge { justify-self: start; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 5px 10px; border-radius: 6px; background: var(--glass); backdrop-filter: blur(8px); }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badges .badge { text-transform: none; letter-spacing: 0; font-size: 13px; }
.back { justify-self: start; display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: var(--soft); font-size: 14px; }
.back:hover { color: var(--text); }
.back svg.lucide { width: 18px; height: 18px; }

/* ---------- Boutons ---------- */
.btns { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.btn { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 28px; border-radius: 99px; background: #fff; color: #05070d; font-weight: 600; text-decoration: none; transition: transform .15s; }
.btn:hover { transform: scale(1.03); }
.btn.glass { background: var(--glass); color: var(--text); backdrop-filter: blur(8px); }

/* ---------- Progression (bannière) ---------- */
.prog { display: flex; align-items: center; gap: 36px; flex-wrap: wrap; margin-top: 18px; }
.prog-main { width: min(300px, 100%); display: grid; gap: 8px; }
.prog-row { display: flex; justify-content: space-between; align-items: baseline; }
.prog-main .pct { font-size: 44px; font-weight: 300; line-height: 1; }
.prog-row span:last-child { color: var(--soft); font-size: 14px; }
.thin { height: 4px; border-radius: 99px; background: rgba(255,255,255,.2); overflow: hidden; }
.thin > i { display: block; height: 100%; width: 0; background: #fff; border-radius: 99px; transition: width .4s; }
.cups { display: flex; gap: 22px; flex-wrap: wrap; font-size: 18px; font-weight: 500; }
.cups span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Accueil ---------- */
main.home { display: grid; gap: 56px; padding-top: 8px; padding-bottom: 80px; }
.home h2 { margin: 0 0 18px; font-weight: 400; font-size: 26px; }
.prog-cards { display: flex; gap: 20px; flex-wrap: wrap; }
.prog-card { flex: 0 1 440px; display: flex; gap: 18px; align-items: center; padding: 16px; border-radius: 16px; background: var(--panel); text-decoration: none; transition: background .15s; }
.prog-card:hover { background: var(--panel2); }
.prog-card img { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; flex: none; }
.prog-card .info { flex: 1; min-width: 0; display: grid; gap: 8px; }
.prog-card .name { font-weight: 600; font-size: 17px; }
.prog-card .cups { font-size: 14px; gap: 12px; color: var(--muted); }
.prog-card .bar-row { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.prog-card .thin { flex: 1; background: var(--panel2); }

.tiles { display: flex; gap: 20px; flex-wrap: wrap; }
.tile { width: 240px; display: grid; gap: 8px; align-content: start; text-decoration: none; }
.tile .art { width: 240px; height: 240px; border-radius: 16px; overflow: hidden; position: relative; background: var(--panel); }
.tile .art img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.tile:hover .art img { transform: scale(1.05); }
.tile .art .badge { position: absolute; left: 12px; top: 12px; background: rgba(0,0,0,.55); font-size: 11px; }
.tile .t { font-weight: 600; }
.tile .s { font-size: 14px; color: var(--muted); }
.tile .empty-art { display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); text-align: center; }
@media (max-width: 560px) { .tile, .tile .art { width: 100%; } .tile .art { height: auto; aspect-ratio: 1; } }

/* ---------- Page jeu ---------- */
main.game { padding-bottom: 80px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { height: 42px; padding: 0 20px; border-radius: 99px; border: 0; background: rgba(255,255,255,.08); color: var(--soft); font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.pill:hover { background: rgba(255,255,255,.14); }
.pill[aria-selected="true"], .pill[aria-pressed="true"] { background: #fff; color: #05070d; }
.pill .n { font-weight: 400; opacity: .75; }
.pill.small { height: 38px; padding: 0 16px; font-size: 14px; font-weight: 500; background: transparent; border: 1px solid var(--line); }
.pill.small[aria-pressed="true"] { border-color: #fff; background: #fff; color: #05070d; }
.tabs { margin: 8px 0 28px; }
.panel[hidden] { display: none; }

.notice { display: flex; gap: 18px; align-items: center; padding: 18px 20px; border-radius: 16px; background: var(--danger-bg); margin-bottom: 28px; }
.notice .dot { width: 40px; height: 40px; border-radius: 50%; background: var(--danger); color: var(--danger-bg); display: grid; place-items: center; flex: none; }
.notice p { margin: 0; color: var(--soft); }
.notice b { color: var(--text); }

.toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.right-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 10px; background: rgba(255,255,255,.08); color: var(--muted); }
.search input { background: none; border: 0; outline: none; color: var(--text); font: inherit; font-size: 14px; width: 220px; }
.search svg.lucide { width: 16px; height: 16px; }
.select { position: relative; display: inline-flex; align-items: center; }
.select select { appearance: none; height: 38px; padding: 0 36px 0 14px; border-radius: 10px; border: 0; background: rgba(255,255,255,.08); color: var(--soft); font: inherit; font-size: 14px; cursor: pointer; }
.select select option { background: var(--panel); }
.select svg.lucide { position: absolute; right: 10px; width: 16px; height: 16px; pointer-events: none; color: var(--soft); }
.subfilters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); cursor: pointer; margin-left: auto; }
.switch input { accent-color: #fff; width: 16px; height: 16px; }

.list { border-radius: 16px; overflow: hidden; background: var(--panel); }
.row { display: flex; gap: 18px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--panel2); }
.row .art { width: 64px; height: 64px; border-radius: 10px; flex: none; display: grid; place-items: center; }
.row .art.P { background: var(--tile-P); } .row .art.G { background: var(--tile-G); } .row .art.S { background: var(--tile-S); } .row .art.B { background: var(--tile-B); }
.row .art.locked { background: var(--panel2); color: var(--dim); }
.row .info { flex: 1; min-width: 0; display: grid; gap: 3px; }
.row .name { font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row .desc { font-size: 14px; color: var(--muted); }
.row .meta { font-size: 13px; color: var(--dim); }
.row .meta .warn { color: #ffc26b; }
.tag-miss { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--danger); color: var(--danger-bg); letter-spacing: .04em; }
.row .side { display: flex; align-items: center; gap: 14px; flex: none; }
.row .when { font-size: 13px; color: var(--muted); text-align: right; }
.check { width: 32px; height: 32px; border-radius: 50%; padding: 0; border: 2px solid var(--dim); background: transparent; display: grid; place-items: center; color: transparent; }
.check:hover { border-color: #fff; }
.check svg.lucide { width: 16px; height: 16px; stroke-width: 3.2; }
.row.done .check { background: #fff; border-color: #fff; color: #05070d; }
.row.done .art { opacity: 1; }
.row:not(.done) .art svg { opacity: .55; }
.tip { padding: 0 20px 18px 102px; border-bottom: 1px solid var(--line); background: var(--panel); }
.tip p { margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--panel2); color: var(--soft); font-size: 15px; }
.reveal { border: 0; background: none; padding: 0; color: var(--link); font-size: 14px; text-align: left; }
.empty { text-align: center; color: var(--muted); padding: 48px 0; }
@media (max-width: 640px) {
  .row { gap: 12px; padding: 14px; }
  .row .art { width: 48px; height: 48px; }
  .row .when { display: none; }
  .tip { padding: 0 14px 14px; }
  .search input { width: 140px; }
}

/* Roadmap */
.steps { display: grid; gap: 20px; }
.step { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); border-radius: 16px; overflow: hidden; background: var(--panel); }
.step img { width: 100%; height: 100%; min-height: 220px; object-fit: cover; display: block; }
.step .body { padding: 24px 28px; display: grid; gap: 12px; align-content: start; }
.step .head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.step .num { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.step h3 { margin: 0; font-weight: 400; font-size: 24px; }
.step .time { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--soft); }
.step .time svg.lucide { width: 16px; height: 16px; }
.step ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.step li { display: grid; grid-template-columns: auto 1fr; gap: 12px; color: var(--soft); }
.step li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--link); margin-top: 9px; }
@media (max-width: 820px) { .step { grid-template-columns: 1fr; } .step img { min-height: 0; aspect-ratio: 16 / 9; } }

/* À savoir */
.facts { display: grid; gap: 12px; }
.fact { display: flex; gap: 16px; padding: 18px 20px; border-radius: 16px; background: var(--panel); }
.fact .ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--panel2); color: var(--soft); }
.fact.danger .ico { background: var(--danger); color: var(--danger-bg); }
.fact strong { display: block; margin-bottom: 2px; }
.fact p { margin: 0; color: var(--muted); }

/* ---------- Pied de page ---------- */
footer { border-top: 1px solid var(--line); }
footer .wrap { padding-top: 24px; padding-bottom: 32px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--dim); }
footer a { color: var(--muted); }

/* =========================================================
   Animations
   ========================================================= */
@keyframes kenburns { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes shine { 0% { filter: brightness(1); transform: scale(1) rotate(0); } 40% { filter: brightness(1.8) drop-shadow(0 0 10px currentColor); transform: scale(1.2) rotate(-8deg); } 100% { filter: brightness(1); transform: scale(1) rotate(0); } }
@keyframes flash { from { background: color-mix(in srgb, #fff 10%, var(--panel)); } to { background: var(--panel); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }
@keyframes toastBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.banner-img { animation: kenburns 1.8s cubic-bezier(.2,.7,.2,1) both; }
.banner .wrap > * { animation: fadeUp .7s cubic-bezier(.2,.7,.2,1) both; }
.banner .wrap > :nth-child(2) { animation-delay: .08s; }
.banner .wrap > :nth-child(3) { animation-delay: .16s; }
.banner .wrap > :nth-child(4) { animation-delay: .24s; }
.banner .wrap > :nth-child(5) { animation-delay: .32s; }

/* Apparition au défilement (classe ajoutée par js/anim.js) */
.reveal-on { opacity: 0; transform: translateY(18px); transition: opacity .6s cubic-bezier(.2,.7,.2,1), transform .6s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }
.reveal-on.in { opacity: 1; transform: none; }

.panel:not([hidden]) { animation: fadeIn .35s ease both; }
.tip { animation: fadeUp .3s cubic-bezier(.2,.7,.2,1) both; }
.list.anim .row { animation: fadeIn .35s ease both; }
.row.just { animation: flash 1s ease both; }
.row.just .check { animation: pop .45s cubic-bezier(.2,.9,.3,1.4) both; }
.row.just .art svg { animation: shine .9s ease both; opacity: 1; }
.pill, .tile, .prog-card, .btn, .check, .icon-btn { transition: background .15s, color .15s, border-color .15s, transform .2s cubic-bezier(.2,.7,.2,1); }
.pill:active, .btn:active, .check:active { transform: scale(.94); }
.prog-card:hover { transform: translateY(-3px); }
.tile:hover { transform: translateY(-4px); }

/* Notification « Trophée obtenu » */
.toasts { position: fixed; top: 20px; right: 20px; z-index: 100; display: grid; gap: 10px; }
.toast {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px;
  width: min(360px, calc(100vw - 40px)); padding: 14px 16px; border-radius: 14px;
  background: rgba(20, 22, 30, .92); backdrop-filter: blur(14px); box-shadow: 0 12px 40px rgba(0,0,0,.5);
  animation: toastIn .45s cubic-bezier(.2,.8,.2,1) both;
}
.toast.out { animation: toastOut .35s ease both; }
.toast .art { width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.toast .art.P { background: var(--tile-P); } .toast .art.G { background: var(--tile-G); } .toast .art.S { background: var(--tile-S); } .toast .art.B { background: var(--tile-B); }
.toast .art svg { animation: shine 1s .2s ease both; }
.toast small { display: block; font-size: 12px; color: var(--muted); }
.toast b { font-size: 15px; }
.toast::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: #fff; transform-origin: left; animation: toastBar 3.5s linear both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal-on { opacity: 1; transform: none; }
}
