/* « Le mot et l'image » adaptatif : onglets, album, univers, espace parents.
   Complète jeux.css. */
.tabs { display: flex; gap: 6px; margin: 0 0 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 0; background: var(--card); color: var(--muted); font: 700 .95rem var(--font-body); padding: 10px 16px; border-radius: 999px; cursor: pointer; box-shadow: 0 1px 0 var(--line); }
.tab[aria-selected="true"] { background: var(--navy); color: #fff; }
@media (prefers-color-scheme: dark) { .tab[aria-selected="true"] { background: var(--teal); color: #0d1524; } }

.choice img, .target-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.choices.n4 { grid-template-columns: repeat(2, 1fr); max-width: 460px; margin: 0 auto; }
.choices.n6 { grid-template-columns: repeat(3, 1fr); }
.quiz-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.word.no-vowels { letter-spacing: .02em; }
.fb-next { margin-inline-start: auto; }
.theme-tag { font-size: .85rem; color: var(--muted); margin-top: 2px; }

/* Accueil */
.home-grid { display: grid; gap: 16px; }
.hero-line { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hero-line h1 { margin: 0; }
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.chip { background: var(--panel); border-radius: 14px; padding: 12px; text-align: center; }
@media (prefers-color-scheme: dark) { .chip, .next-piece, .badge, .album-word, .piece, .stat-row, .univ-other { background: #1b2a47 !important; } }
.chip b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.7rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.chip span { font-size: .82rem; color: var(--muted); }
.next-piece { display: flex; gap: 16px; align-items: center; background: var(--panel); border-radius: 16px; padding: 14px 16px; }
.next-piece .sil { width: 72px; height: 72px; flex: none; }
.next-piece p { margin: 0; }
.bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--gold); border-radius: 999px; }
.start-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.palier-dots { display: flex; gap: 6px; align-items: center; }
.palier-dots i { width: 26px; height: 8px; border-radius: 4px; background: var(--line); }
.palier-dots i.on { background: var(--gold); }
.note { font-size: .88rem; color: var(--muted); }
.warn { background: var(--bad-soft); color: var(--ink); border-radius: 12px; padding: 10px 14px; font-size: .92rem; }

/* Silhouettes */
.sil.done img, .sil.done svg { filter: none !important; }
.sil img, .sil svg { width: 100%; height: 100%; object-fit: contain; filter: brightness(0) opacity(.18); }
@media (prefers-color-scheme: dark) { .sil img, .sil svg { filter: brightness(0) invert(1) opacity(.18); } }

/* Badges */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.badge { background: var(--panel); border-radius: 12px; padding: 10px; display: flex; gap: 8px; align-items: center; font-size: .85rem; }
.badge svg { width: 28px; height: 28px; flex: none; }
.badge.off { opacity: .45; }
.badge.off svg { filter: grayscale(1); }
.badge b { display: block; font-size: .9rem; color: var(--ink); }
.badge { color: var(--muted); font-size: .8rem; line-height: 1.3; }

/* Résultat : événements */
.events { display: grid; gap: 8px; width: 100%; max-width: 520px; }
.event { display: flex; gap: 12px; align-items: center; background: var(--good-soft); border-radius: 12px; padding: 10px 14px; text-align: start; }
.event.down { background: var(--bad-soft); }
.event.neutral { background: var(--panel); }
.event .ev-img { width: 48px; height: 48px; flex: none; }
.event .ev-img img, .event .ev-img svg { width: 100%; height: 100%; }
.piece-won { animation: pop .6s ease; }
@keyframes pop { 0% { transform: scale(.4); } 70% { transform: scale(1.1); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .piece-won { animation: none; } }
.recap img { width: 26px; height: 26px; }

/* Album */
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.pill { border: 2px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: 600 .85rem var(--font-body); cursor: pointer; }
.pill[aria-pressed="true"] { border-color: var(--gold); background: var(--gold); color: var(--navy); }
.pill.locked { color: var(--muted); }
.pill small { font-variant-numeric: tabular-nums; opacity: .8; }
.album-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.album-head .ar { font-family: var(--font-ar); font-size: 1.5rem; color: var(--teal); }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.album-word { background: var(--panel); border-radius: 14px; padding: 10px; text-align: center; border: 4px solid transparent; display: grid; gap: 4px; justify-items: center; }
.album-word .pic { width: 70px; height: 70px; }
.album-word .pic img { width: 100%; height: 100%; }
.album-word .ar { font-family: var(--font-ar); font-size: 1.35rem; line-height: 1.5; }
.album-word .fr { font-size: .8rem; color: var(--muted); }
.album-word.bronze { border-color: #b87333; }
.album-word.argent { border-color: #a9b4bd; }
.album-word.or { border-color: var(--gold); }
.album-word.encours .pic img { filter: grayscale(1) opacity(.55); }
.album-word.soon { border: 2px dashed var(--line); background: transparent; }
.album-word.soon .pic { display: grid; place-items: center; color: var(--muted); font-size: .8rem; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin-top: 14px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-inline-end: 4px; border: 3px solid; }
.locked-msg { text-align: center; color: var(--muted); padding: 30px 10px; }

/* Univers */
.player { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: center; margin-bottom: 18px; }
.player .shirt { width: 120px; height: 120px; }
.player h2 { margin: 0; }
.pieces { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.piece { background: var(--panel); border-radius: 14px; padding: 8px; text-align: center; display: grid; gap: 4px; justify-items: center; position: relative; }
.piece .pic { width: 100%; aspect-ratio: 1; max-width: 80px; }
.piece .pic img, .piece .pic svg { width: 100%; height: 100%; object-fit: contain; }
.piece .lbl { font-size: .74rem; color: var(--muted); line-height: 1.25; }
.piece.won { box-shadow: inset 0 0 0 3px var(--gold); }
.piece.won .lbl { color: var(--ink); font-weight: 600; }
.piece.next { box-shadow: inset 0 0 0 2px dashed var(--teal); outline: 2px dashed var(--teal); outline-offset: -2px; }
.piece .num { position: absolute; top: 4px; inset-inline-start: 8px; font-size: .7rem; color: var(--muted); font-weight: 700; }
.piece.lock .pic { display: grid; place-items: center; font-family: var(--font-display); font-size: 1.6rem; color: var(--line); }
.univ-others { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.univ-other { background: var(--panel); border-radius: 14px; padding: 12px; opacity: .7; }
.univ-other .ar { font-family: var(--font-ar); color: var(--teal); }
.univ-other p { margin: 4px 0 0; font-size: .82rem; color: var(--muted); }
@media (max-width: 600px) { .pieces { grid-template-columns: repeat(3, 1fr); } .univ-others { grid-template-columns: 1fr; } .chips { grid-template-columns: repeat(2, 1fr); } .player { grid-template-columns: 84px 1fr; } .player .shirt { width: 84px; height: 84px; } }

/* Choix du joueur */
.form-grid { display: grid; gap: 14px; max-width: 420px; }
.form-grid label { font-weight: 700; display: grid; gap: 6px; }
.form-grid input { font: 400 1.05rem var(--font-body); padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.swatch[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--card) inset; }
.setup { display: grid; grid-template-columns: 1fr 160px; gap: 20px; align-items: center; }
.setup .preview { width: 160px; height: 160px; }
@media (max-width: 600px) { .setup { grid-template-columns: 1fr; } .setup .preview { order: -1; margin: 0 auto; width: 120px; height: 120px; } }

/* Espace parents */
.gate { max-width: 360px; margin: 0 auto; text-align: center; display: grid; gap: 12px; }
.gate input { font: 700 1.4rem var(--font-body); text-align: center; padding: 10px; border: 2px solid var(--line); border-radius: 10px; width: 140px; margin: 0 auto; background: var(--card); color: var(--ink); }
.stat-rows { display: grid; gap: 6px; }
.stat-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 12px; align-items: center; background: var(--panel); border-radius: 10px; padding: 8px 12px; font-size: .9rem; }
.stat-row .bar { margin: 0; }
.stat-row span:last-child { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.stat-row.locked { opacity: .5; }
table.hist { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
table.hist th, table.hist td { text-align: start; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.hist th { color: var(--muted); font-weight: 600; }
.section-title { font-family: var(--font-display); font-size: 1.15rem; margin: 22px 0 10px; }
.danger { background: transparent; border: 2px solid var(--bad); color: var(--bad); }
.confirm { background: var(--bad-soft); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.confirm .btn { padding: 10px 18px; }
.btn-bad { background: var(--bad); color: #fff; }
.credit { text-align: center; font-size: .78rem; color: var(--muted); margin-top: 26px; }
.credit a { color: inherit; }
.diff-list { display: flex; flex-wrap: wrap; gap: 8px; }
.diff-list span { background: var(--bad-soft); border-radius: 10px; padding: 4px 10px; font-size: .9rem; }
.diff-list .ar { font-family: var(--font-ar); font-size: 1.15rem; }

/* Son, progression lisible, « Comment ça marche ? » */
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.son-btn { all: unset; cursor: pointer; font-size: 1.25rem; line-height: 1; padding: 4px 6px; border-radius: 8px; }
.son-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.en-route { background: var(--panel); border-radius: 12px; padding: 10px 14px; font-size: .92rem; }
.cpt { letter-spacing: .1em; color: var(--gold); font-size: .9rem; white-space: nowrap; }
.album-word .cpt { font-size: .85rem; }
.how { background: var(--panel); border-radius: 12px; padding: 10px 14px; font-size: .92rem; }
.how summary { cursor: pointer; font-weight: 700; color: var(--teal); }
.how ul { margin: 8px 0 2px; padding-inline-start: 18px; display: grid; gap: 6px; }
@media (prefers-color-scheme: dark) { .en-route, .how { background: #1b2a47 !important; } }
