/* Platine : pochettes de jazz, aplats ; cartes en couleurs naturelles. */

:root {
  --cobalt: #1e3bff;
  --cobalt-deep: #1328b8;
  --signal: #ffd400;
  --ink: #000;
  --ink-soft: #3c3f46;
  --ink-mute: #6b6f78;
  --paper: #ececea;
  --sheet: #fff;
  --line: #d3d3cf;
  --vermillon: #ff4a1c;
  --ok: #138a4b;

  --r-C: #c9ccd3;
  --r-PC: #34c98e;
  --r-R: #3b8cff;
  --r-OR: #e0ad2e;
  --r-PL: #a3aec0;
  --r-DI: #5fd3f0;

  --display: 'Sofia Sans Extra Condensed', 'Arial Narrow', sans-serif;
  --text: 'Sofia Sans', system-ui, sans-serif;
  --step--1: 0.84rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.2rem;
  --step-4: 3.2rem;
  --step-5: 5rem;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ink: #f4f4f2;
    --ink-soft: #c9cbd2;
    --ink-mute: #9599a4;
    --paper: #0d0f1f;
    --sheet: #171a33;
    --line: #2c3054;
    --cobalt: #4d66ff;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --ink: #f4f4f2; --ink-soft: #c9cbd2; --ink-mute: #9599a4; --paper: #0d0f1f; --sheet: #171a33; --line: #2c3054; --cobalt: #4d66ff; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--step-0);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px var(--gutter) 64px; outline: none; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--signal); color: #000; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 0.95; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
p { margin: 0 0 0.8em; max-width: 68ch; }
.mute { color: var(--ink-mute); }
.num { font-family: var(--display); font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Bandeau ---------- */

.topbar {
  background: var(--cobalt);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 var(--gutter);
  min-height: 64px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.logo { font-family: var(--display); font-weight: 900; font-size: 2.4rem; line-height: 1; text-decoration: none; letter-spacing: -0.03em; display: flex; align-items: center; gap: 8px; }
.logo svg { width: 28px; height: 28px; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { text-decoration: none; padding: 8px 12px; font-weight: 500; white-space: nowrap; border-bottom: 3px solid transparent; }
.nav a:hover { border-bottom-color: rgba(255, 255, 255, 0.5); }
.nav a[aria-current='page'] { border-bottom-color: var(--signal); }
.wallet { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.wallet .num { font-size: 1.5rem; }
.wallet a { text-decoration: none; }
.bell { position: relative; display: inline-flex; padding: 6px; }
.bell .dot { position: absolute; top: 0; right: -2px; background: var(--signal); color: #000; font-size: 0.7rem; font-weight: 700; border-radius: 10px; padding: 0 5px; line-height: 1.4; }
.coin { display: inline-block; width: 0.9em; height: 0.9em; border-radius: 50%; background: radial-gradient(circle, #000 0 18%, var(--signal) 19% 100%); vertical-align: -0.08em; margin-right: 4px; }

@media (max-width: 1180px) {
  .topbar { flex-wrap: wrap; gap: 4px 14px; padding-top: 8px; }
  .nav { order: 3; flex-basis: 100%; }
  .logo { font-size: 2rem; }
  .wallet { margin-left: auto; }
}

/* ---------- Boutons, champs ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 2px solid var(--ink); background: var(--sheet); color: var(--ink);
  padding: 10px 18px; border-radius: 4px; font-weight: 700; cursor: pointer; text-decoration: none;
  transition: transform 0.08s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--signal); border-color: #000; color: #000; }
.btn.blue { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; text-decoration: underline; padding-inline: 6px; }
.btn.small { padding: 5px 10px; font-size: var(--step--1); }
.btn.danger { border-color: var(--vermillon); color: var(--vermillon); }

label { display: block; font-weight: 500; margin-bottom: 4px; }
input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='search'], select, textarea {
  width: 100%; padding: 10px 12px; border: 2px solid var(--line); border-radius: 4px; background: var(--sheet);
}
input:focus, select:focus, textarea:focus { border-color: var(--cobalt); outline: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--cobalt); }
.field { margin-bottom: 16px; }
.form-error { color: var(--vermillon); font-weight: 700; min-height: 1.5em; }

.panel { background: var(--sheet); border: 2px solid var(--line); padding: 20px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack > * + * { margin-top: 24px; }
.section-title { display: flex; align-items: baseline; gap: 14px; justify-content: space-between; margin: 40px 0 16px; flex-wrap: wrap; }
.empty { padding: 32px; text-align: center; border: 2px dashed var(--line); color: var(--ink-soft); }

/* ---------- Cartes ----------
   Photo en couleurs naturelles sur carton blanc. La rareté tient au cadre : trait gris,
   menthe, azur, puis feuilles or, platine et irisée. L'époque est imprimée dans une encoche
   au pied de la photo, pour situer l'artiste d'un coup d'œil. */

.card {
  --tone: var(--r-C);
  --tone-ink: #4a4f59;
  --foil: var(--tone);
  position: relative;
  aspect-ratio: 5 / 7;
  border-radius: 12px;
  color: #000;
  border: 3px solid transparent;
  background: linear-gradient(#fff, #fff) padding-box, var(--foil) border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-decoration: none;
  container-type: inline-size;
  transition: transform 0.15s ease;
}
a.card:hover { transform: translateY(-4px) rotate(-0.6deg); }
.card.r-C { border-width: 2px; }
.card.r-PC { --tone: var(--r-PC); --tone-ink: #0d8a5a; }
.card.r-R { --tone: var(--r-R); --tone-ink: #1f66d6; }
.card.r-OR, .card.r-PL, .card.r-DI { border-width: 4px; }
.card.r-OR { --tone: var(--r-OR); --tone-ink: #a87a00; --foil: linear-gradient(135deg, #fff1b8, #dca42a 26%, #fbe7a1 50%, #bd8612 74%, #f6dc8a); }
.card.r-PL { --tone: var(--r-PL); --tone-ink: #4f5d73; --foil: linear-gradient(135deg, #f4f6f9, #8e9bb2 26%, #e6eaf0 50%, #74819a 74%, #d9dee7); }
.card.r-DI { --tone: var(--r-DI); --tone-ink: #0b8fb0; --foil: linear-gradient(135deg, #ff8fcf, #47d4ff 25%, #a184ff 50%, #4fe8a4 75%, #ffbf5c); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; padding: 6.5cqw 6.5cqw 3.5cqw; }
.card-name { font-family: var(--display); font-weight: 800; font-size: 11cqw; line-height: 0.92; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.disc { flex: none; width: 8.5cqw; height: 8.5cqw; border-radius: 50%; background: radial-gradient(circle, #fff 0 15%, transparent 16%), var(--foil); box-shadow: inset 0 0 0 0.6cqw rgba(0, 0, 0, 0.06); margin-top: 1cqw; }
.r-DI .disc { border-radius: 1.5cqw; transform: rotate(45deg) scale(0.82); background: var(--foil); }
.card-art { position: relative; flex: 1; min-height: 0; margin: 0 4cqw; background: #eceef1; overflow: hidden; border-radius: 2.4cqw; }
.card-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; filter: saturate(0.9) contrast(1.03); }
.card-art.noimg { display: grid; place-items: center; background: repeating-radial-gradient(circle at 50% 50%, #eef0f3 0 1.5px, #e3e6ea 1.5px 4px); }
.card-art .initials { width: 46%; aspect-ratio: 1; border-radius: 50%; border: 3cqw solid transparent; background: linear-gradient(#fff, #fff) padding-box, var(--foil) border-box; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 13cqw; color: var(--tone-ink); }
/* Encoche d'époque : le carton blanc mord dans la photo, l'année s'y lit en grand. */
.card-years { position: absolute; left: 0; bottom: 0; z-index: 2; background: #fff; border-top-right-radius: 2.4cqw; padding: 1.6cqw 2.6cqw 0 0; font-family: var(--display); font-weight: 800; font-size: 10cqw; line-height: 0.95; letter-spacing: 0.01em; color: #000; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card-years small { font-family: var(--text); font-weight: 700; font-size: 5.6cqw; letter-spacing: 0; color: #4a4f59; margin-right: 1.2cqw; vertical-align: 0.4cqw; }
.card-meta { display: flex; flex-wrap: wrap; gap: 1.6cqw; padding: 3cqw 4cqw 0; }
.tag { font-size: 6cqw; font-weight: 700; padding: 0.6cqw 2.4cqw; border-radius: 20px; background: #f1f2f4; color: #2a2d33; white-space: nowrap; }
.tag.kind { background: color-mix(in srgb, var(--tone) 18%, #fff); color: var(--tone-ink); }
.card-desc { font-size: 6.4cqw; line-height: 1.2; margin: 2.5cqw 4cqw 0; color: #3a3f4a; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; }
.card-stats { display: flex; justify-content: space-between; align-items: flex-end; padding: 2cqw 6cqw 5cqw; }
.stat { display: flex; align-items: baseline; gap: 1.5cqw; font-size: 5.6cqw; color: #6b6f78; }
.stat b { font-family: var(--display); font-weight: 900; font-size: 15cqw; line-height: 0.9; color: #000; }
.stat.def b { color: var(--tone-ink); }
.card .count { position: absolute; top: 6px; left: 6px; z-index: 3; background: #000; color: #fff; font-weight: 700; font-size: 0.75rem; border-radius: 10px; padding: 0 7px; }
.card .fav { position: absolute; top: 35%; right: 6px; z-index: 3; color: var(--signal); font-size: 1.2rem; text-shadow: 0 0 2px #000; }
.card .new { position: absolute; top: 24%; left: -4px; z-index: 3; background: var(--signal); color: #000; font-family: var(--display); font-weight: 900; font-size: 1.1rem; padding: 0 10px; transform: rotate(-6deg); }

/* Reflet de la feuille pour les raretés hautes, au survol et à l'ouverture d'un booster. */
.r-OR .card-art::before, .r-PL .card-art::before, .r-DI .card-art::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.65) 45%, transparent 60%);
  background-size: 250% 100%; transition: opacity 0.2s;
}
a.card:hover .card-art::before, .reveal .card-art::before { opacity: 1; animation: sheen 1.3s ease; }
@keyframes sheen { from { background-position: 120% 0; } to { background-position: -40% 0; } }
@media (prefers-reduced-motion: reduce) { a.card:hover .card-art::before, .reveal .card-art::before { animation: none; opacity: 0; } }

/* Carte manquante : silhouette. */
.card.missing { background: transparent; border-style: dashed; border-color: var(--line); color: var(--ink-mute); display: grid; place-items: center; text-align: center; }
.card.missing .q { font-family: var(--display); font-weight: 900; font-size: 30cqw; line-height: 1; opacity: 0.3; }
.card.missing small { font-size: 6.5cqw; }

/* Dos de carte : le rond central d'un 45 tours. */
.card-back {
  position: relative; aspect-ratio: 5 / 7; border-radius: 12px; border: 3px solid #000;
  background: repeating-radial-gradient(circle at 50% 50%, #0b0b0b 0 2px, #1c1c1c 2px 5px);
  container-type: inline-size;
}
.card-back::before {
  content: ''; position: absolute; left: 24%; top: calc(50% - 26cqw); width: 52%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #ececea 0 5%, #1e3bff 5.5% 100%);
}
.card-back::after {
  content: 'platine'; position: absolute; left: 0; right: 0; top: calc(50% + 6cqw); text-align: center;
  color: #fff; font-family: var(--display); font-weight: 900; font-size: 11cqw; line-height: 1;
}

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 18px; }
.grid-cards.small { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
@media (max-width: 520px) {
  .grid-cards { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .grid-cards.small { grid-template-columns: repeat(3, 1fr); gap: 8px; }
}

/* ---------- Accueil connecté ---------- */

.home { display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 40px; align-items: start; }
@media (max-width: 860px) { .home { grid-template-columns: 1fr; } }
.sleeve-wrap { position: relative; }
.sleeve {
  position: relative; width: 100%; aspect-ratio: 1; border: 0; padding: 0; cursor: pointer; background: transparent; display: block;
}
.sleeve .vinyl {
  position: absolute; top: 7%; left: 14%; width: 86%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, var(--paper) 0 2.5%, var(--signal) 3% 17%, #000 17.5% 19%, transparent 19.5%), repeating-radial-gradient(circle, #050505 0 2px, #1a1a1a 2px 4px);
  transition: transform 0.35s ease;
}
.sleeve .cover {
  position: absolute; inset: 0; width: 92%; background: var(--cobalt); color: #fff; text-align: left; padding: 8%;
  display: flex; flex-direction: column; justify-content: space-between;
}
.sleeve .cover strong { font-family: var(--display); font-weight: 900; font-size: clamp(3rem, 9vw, 5.5rem); line-height: 0.85; letter-spacing: -0.03em; }
.sleeve .cover span { font-size: var(--step-1); font-weight: 500; }
@media (hover: hover) { .sleeve:hover:not(:disabled) .vinyl { transform: translateX(6%) rotate(20deg); } }
.sleeve:disabled { cursor: default; }
.sleeve:disabled .cover { background: #555b70; }
.stockline { display: flex; gap: 6px; margin: 18px 0 8px; }
.stockline i { flex: 1; height: 10px; background: var(--line); }
.stockline i.full { background: var(--cobalt); }
.timer { font-family: var(--display); font-weight: 800; font-size: var(--step-2); }
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quick a { background: var(--sheet); border: 2px solid var(--line); padding: 14px; text-decoration: none; }
.quick a:hover { border-color: var(--cobalt); }
.quick .num { font-size: var(--step-3); display: block; line-height: 1; }
.meter { height: 12px; background: var(--line); position: relative; }
.meter span { position: absolute; inset: 0 auto 0 0; background: var(--cobalt); }
.rarity-bars { display: grid; gap: 6px; }
.rarity-bars div { display: grid; grid-template-columns: 100px 1fr 70px; gap: 10px; align-items: center; font-size: var(--step--1); }
.rarity-bars .bar { height: 8px; background: var(--line); position: relative; }
.rarity-bars .bar span { position: absolute; inset: 0 auto 0 0; }

/* ---------- Ouverture de booster ---------- */

.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(5, 8, 30, 0.92); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; }
.opening { position: relative; width: min(340px, 70vw); aspect-ratio: 1; }
.opening .cover { position: absolute; inset: 0; background: var(--cobalt); z-index: 2; display: flex; align-items: flex-end; padding: 8%; font-family: var(--display); font-weight: 900; font-size: 4rem; line-height: 0.85; }
.opening .vinyl { position: absolute; inset: 3%; border-radius: 50%; z-index: 1; background: radial-gradient(circle, var(--paper) 0 2.5%, var(--signal) 3% 17%, #000 17.5% 19%, transparent 19.5%), repeating-radial-gradient(circle, #050505 0 2px, #1a1a1a 2px 4px); animation: slideout 1.1s cubic-bezier(.5, 0, .2, 1) forwards; }
@keyframes slideout { 0% { transform: translateX(0) rotate(0); } 70% { transform: translateX(62%) rotate(240deg); } 100% { transform: translateX(62%) rotate(300deg); } }
.deal { display: grid; grid-template-columns: repeat(5, minmax(0, 190px)); gap: 16px; width: 100%; max-width: 1040px; justify-content: center; }
@media (max-width: 760px) { .deal { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.slot { perspective: 1200px; animation: dealin 0.45s cubic-bezier(.2, .8, .3, 1) both; }
.slot:nth-child(2) { animation-delay: 0.08s; } .slot:nth-child(3) { animation-delay: 0.16s; } .slot:nth-child(4) { animation-delay: 0.24s; } .slot:nth-child(5) { animation-delay: 0.32s; }
@keyframes dealin { from { opacity: 0; transform: translateY(-60px) rotate(-8deg) scale(0.8); } }
.flip { position: relative; width: 100%; aspect-ratio: 5 / 7; transform-style: preserve-3d; transition: transform 0.6s cubic-bezier(.3, .7, .3, 1); cursor: pointer; border: 0; padding: 0; background: none; display: block; }
.flip.on { transform: rotateY(180deg); cursor: default; }
.flip > * { position: absolute; inset: 0; backface-visibility: hidden; }
.flip .front { transform: rotateY(180deg); }
/* Lueur des cartes rares : une ombre portée par la face elle-même. Un filter sur .flip
   aplatirait la 3D et ferait voir le dos à l'envers à la place de la carte. */
.flip.on.hi .front .card { box-shadow: 0 0 0 3px var(--glow, #fff), 0 0 30px 8px var(--glow, #fff); }
.overlay-actions { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.unlocked { margin-top: 16px; background: var(--signal); color: #000; padding: 8px 14px; font-weight: 700; }
.unlocked[hidden] { display: none; }

/* ---------- Album ---------- */

.filters { display: grid; gap: 12px; margin: 20px 0 24px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 2px solid var(--line); background: var(--sheet); padding: 4px 12px; border-radius: 20px; cursor: pointer; font-weight: 500; font-size: var(--step--1); }
.chip[aria-pressed='true'] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .n { color: var(--ink-mute); margin-left: 4px; }
.chip[aria-pressed='true'] .n { color: inherit; opacity: 0.7; }
.filters .row > * { flex: 1 1 160px; }
.pager { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 28px; }

/* ---------- Fiche carte ---------- */

.detail { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 40px; align-items: start; }
@media (max-width: 760px) { .detail { grid-template-columns: 1fr; } .detail > .card { max-width: 300px; } }
.detail h1 { font-size: clamp(2.6rem, 7vw, 5rem); margin-bottom: 12px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 2px; margin: 20px 0; background: var(--line); border: 2px solid var(--line); }
.facts div { background: var(--sheet); padding: 10px 12px; }
.facts dt { font-size: var(--step--1); color: var(--ink-mute); }
.facts dd { margin: 0; font-weight: 700; }
.photo { border: 2px solid var(--line); background: var(--sheet); }
.photo img { max-height: 420px; width: 100%; object-fit: contain; background: #000; }
.photo figcaption { font-size: var(--step--1); padding: 6px 10px; color: var(--ink-mute); }

/* ---------- Duels ---------- */

.board { display: grid; gap: 18px; }
.lane { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.lane .card, .lane .card-back { max-width: 124px; width: 100%; margin-inline: auto; }
.lane-name { font-family: var(--display); font-weight: 800; font-size: var(--step-1); margin: 0 0 6px; }
.lane .slot-card { position: relative; }
.lane .slot-card.current .card { outline: 4px solid var(--signal); outline-offset: 3px; }
.lane .slot-card .hit { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); font-family: var(--display); font-weight: 900; font-size: 1.4rem; padding: 0 8px; background: #000; color: #fff; white-space: nowrap; }
.lane .slot-card .hit.miss { background: var(--vermillon); }
.versus { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.versus .side { font-family: var(--display); font-weight: 800; font-size: var(--step-2); }
.versus .side:last-child { text-align: right; }
.versus .score { font-family: var(--display); font-weight: 900; font-size: var(--step-5); line-height: 0.8; white-space: nowrap; }
@media (max-width: 600px) {
  .versus { grid-template-columns: 1fr 1fr; grid-template-areas: "moi lui" "score score"; row-gap: 8px; }
  .versus .side:first-child { grid-area: moi; }
  .versus .side:last-child { grid-area: lui; }
  .versus .score { grid-area: score; text-align: center; font-size: var(--step-4); }
}
.question { background: var(--sheet); border: 3px solid var(--ink); padding: 24px; }
.question .prompt { font-family: var(--display); font-weight: 800; font-size: var(--step-3); line-height: 1; margin-bottom: 12px; }
.question blockquote { margin: 0 0 16px; padding: 12px 16px; background: var(--paper); border-left: 6px solid var(--cobalt); font-size: var(--step-1); line-height: 1.4; }
.question .qimg { max-height: 260px; width: auto; margin: 0 0 16px; border: 3px solid #000; }
.options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 560px) { .options { grid-template-columns: 1fr; } }
.options button { text-align: left; padding: 14px 16px; border: 2px solid var(--ink); background: var(--sheet); cursor: pointer; font-weight: 700; font-size: var(--step-1); border-radius: 4px; }
.options button:hover:not(:disabled) { background: var(--signal); color: #000; }
.options button.right { background: var(--ok); color: #fff; border-color: var(--ok); }
.options button.wrong { background: var(--vermillon); color: #fff; border-color: var(--vermillon); }
.options button:disabled { cursor: default; }
.clock { height: 6px; background: var(--line); margin: -24px -24px 20px; }
.clock span { display: block; height: 100%; background: var(--cobalt); transform-origin: left; }
.result-banner { font-family: var(--display); font-weight: 900; font-size: clamp(3rem, 10vw, 7rem); line-height: 0.85; }
.result-banner.win { color: var(--cobalt); }
.result-banner.loss { color: var(--vermillon); }

/* ---------- Listes (marché, échanges, classement) ---------- */

.list { display: grid; gap: 10px; }
.item { background: var(--sheet); border: 2px solid var(--line); padding: 12px; display: grid; grid-template-columns: 92px 1fr auto; gap: 16px; align-items: center; }
.item .card { width: 92px; }
.item h3 { font-size: var(--step-2); }
.item .price { font-family: var(--display); font-weight: 900; font-size: var(--step-3); line-height: 1; text-align: right; }
.item .bidform { display: flex; gap: 6px; margin-top: 8px; justify-content: flex-end; }
.item .bidform input { width: 110px; }
@media (max-width: 600px) { .item { grid-template-columns: 72px 1fr; } .item .card { width: 72px; } .item > :last-child { grid-column: 1 / -1; } .item .price { text-align: left; } .item .bidform { justify-content: flex-start; } }
.chart { width: 100%; border-collapse: collapse; background: var(--sheet); }
.chart th, .chart td { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--line); }
.chart th { font-size: var(--step--1); color: var(--ink-mute); font-weight: 500; }
.chart td.pos { font-family: var(--display); font-weight: 900; font-size: var(--step-2); width: 60px; }
.chart tr.me td { background: color-mix(in srgb, var(--signal) 30%, transparent); }
.chart .r { text-align: right; }
/* Sur téléphone, les colonnes secondaires (.wide) disparaissent et les cellules se resserrent. */
@media (max-width: 600px) {
  .chart th, .chart td { padding: 8px 6px; }
  .chart td.pos { width: 32px; font-size: var(--step-1); }
  .chart .wide { display: none; }
}
.tabs { display: flex; gap: 4px; border-bottom: 3px solid var(--ink); margin: 16px 0 20px; flex-wrap: wrap; }
.tabs button, .tabs a { border: 0; background: transparent; padding: 8px 14px; cursor: pointer; font-weight: 700; text-decoration: none; }
.tabs [aria-selected='true'] { background: var(--ink); color: var(--paper); }
.trade { background: var(--sheet); border: 2px solid var(--line); padding: 16px; }
.sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; margin: 12px 0; }
.swap { font-family: var(--display); font-size: 2.4rem; font-weight: 900; }
@media (max-width: 600px) { .sides { grid-template-columns: 1fr; } .swap { transform: rotate(90deg); justify-self: center; } }
.picker { max-height: 52vh; overflow-y: auto; padding: 4px; }
.picker .card { cursor: pointer; }
.picker .pick { position: relative; border: 0; padding: 0; background: none; cursor: pointer; text-align: left; }
.picker .pick[aria-pressed='true'] .card { outline: 4px solid var(--signal); outline-offset: 2px; }
.picker .pick[aria-pressed='true']::after { content: '✓'; position: absolute; top: -6px; right: -6px; background: var(--signal); color: #000; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; z-index: 4; }

/* ---------- Fenêtre modale ---------- */

dialog { border: 3px solid var(--ink); background: var(--paper); color: var(--ink); padding: 0; width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
dialog::backdrop { background: rgba(5, 8, 30, 0.7); }
dialog .dhead { background: var(--cobalt); color: #fff; padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
dialog .dbody { padding: 20px; overflow-y: auto; max-height: calc(100vh - 200px); }
dialog .dfoot { padding: 14px 20px; border-top: 2px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ---------- Page d'accueil (visiteur) ---------- */

.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; min-height: 70vh; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; min-height: 0; } }
.hero h1 { font-size: clamp(3.4rem, 9vw, 7.5rem); line-height: 0.82; letter-spacing: -0.035em; font-weight: 900; margin-bottom: 24px; }
.hero .lede { font-size: var(--step-1); max-width: 46ch; }
.fan { position: relative; height: clamp(320px, 46vw, 480px); }
.fan .card { position: absolute; width: clamp(170px, 22vw, 240px); top: 8%; left: 50%; box-shadow: 8px 8px 0 #000; }
.fan .card:nth-child(1) { transform: translateX(-112%) rotate(-11deg) translateY(30px); }
.fan .card:nth-child(2) { transform: translateX(-50%) rotate(0deg); z-index: 2; }
.fan .card:nth-child(3) { transform: translateX(12%) rotate(10deg) translateY(30px); }
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; border-top: 3px solid var(--ink); margin-top: 48px; }
.rules > div { padding: 20px 20px 20px 0; }
.rules h3 { font-size: var(--step-2); margin-bottom: 8px; }
.auth { max-width: 460px; margin: 20px auto; }
.auth h1 { margin-bottom: 20px; }

/* ---------- Divers ---------- */

.toasts { position: fixed; bottom: 16px; right: 16px; left: 16px; display: grid; justify-items: end; gap: 8px; z-index: 60; pointer-events: none; }
.toast { background: #000; color: #fff; padding: 12px 16px; border-left: 6px solid var(--signal); max-width: 420px; pointer-events: auto; animation: toastin 0.2s ease; }
.toast.error { border-left-color: var(--vermillon); }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } }
.credits { font-size: var(--step--1); color: var(--ink-mute); padding: 18px var(--gutter); border-top: 2px solid var(--line); }
.credits p { max-width: none; margin: 0; }
.badge-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ach { background: var(--sheet); border: 2px solid var(--line); padding: 14px; display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; }
.ach .medal { width: 48px; height: 48px; border-radius: 50%; background: repeating-radial-gradient(circle, #1a1a1a 0 2px, #2a2a2a 2px 4px); display: grid; place-items: center; }
.ach .medal::after { content: ''; width: 40%; height: 40%; border-radius: 50%; background: var(--line); }
.ach.got .medal::after { background: var(--signal); }
.ach:not(.got) { opacity: 0.6; }
.ach h3 { font-size: var(--step-1); }
.notif { padding: 10px 0; border-bottom: 2px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.notif.unread { font-weight: 700; }
.loading { padding: 40px; text-align: center; color: var(--ink-mute); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
