/* Tiboum — composants « album de stickers ». Toutes les valeurs viennent de tokens.css. */
.td-root, body { font-family: var(--font-body); font-weight: 700; color: var(--ink); }
body { background-color: var(--paper); background-image: radial-gradient(rgba(43, 34, 56, .09) 1.3px, transparent 1.4px); background-size: 22px 22px; margin: 0; padding: 16px; }
:focus-visible { outline: 3px dashed var(--ink); outline-offset: 3px; }

.td-eyebrow { font-size: .85rem; font-weight: 800; color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; }
.td-h-section { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; margin: 2px 0 0; }

/* ─── Sticker ─── */
.td-sticker { background: var(--card); border: var(--line) solid var(--ink); border-radius: var(--radius-sticker); box-shadow: var(--shadow); }
.td-sticker--pad { padding: var(--space-18); }
.td-tone--butter { background: var(--butter); } .td-tone--mint { background: var(--mint); } .td-tone--sky { background: var(--sky); }
.td-tone--coral { background: var(--coral); } .td-tone--lilac { background: var(--lilac); }

/* ─── Bouton ─── */
.td-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: var(--radius-pill);
  border: var(--line) solid var(--ink); background: var(--card); box-shadow: var(--shadow-sm); font: inherit; font-weight: 900; font-size: 1rem; color: var(--ink);
  cursor: pointer; transition: transform .08s, box-shadow .08s; white-space: nowrap; }
.td-btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: var(--shadow-none); }
.td-btn:disabled { opacity: .45; cursor: not-allowed; }
.td-btn--primary { background: var(--coral); } .td-btn--good { background: var(--mint); } .td-btn--bad { background: var(--bad-soft); }
.td-btn--ghost { background: transparent; box-shadow: none; border-style: dashed; } .td-btn--parent { background: var(--butter); font-size: .95rem; }
.td-btn--small { padding: 7px 14px; font-size: .88rem; } .td-btn--big { font-size: 1.35rem; padding: 18px 40px; box-shadow: var(--shadow); }
.td-btn--block { width: 100%; }

/* ─── Montant ─── */
.td-amount { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-display); font-weight: 900; white-space: nowrap; }
.td-amount--lg { font-size: 1.5rem; } .td-amount--xl { font-size: 2.6rem; line-height: 1; } .td-amount--neg { color: var(--bad-text); }
.td-sand { display: inline-block; vertical-align: -0.14em; overflow: visible; }

/* ─── Mission ─── */
.td-mission { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--card); border: var(--line) solid var(--ink); border-radius: var(--radius-mission); box-shadow: var(--shadow-sm); transition: transform .08s, box-shadow .08s, background .2s; }
.td-mission:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: var(--shadow-none); }
.td-mission-check { width: 34px; height: 34px; border-radius: 50%; border: var(--line) solid var(--ink); display: grid; place-items: center; flex-shrink: 0; background: #fff; font-weight: 900; }
.td-mission-ico { font-size: 1.6rem; width: 34px; text-align: center; flex-shrink: 0; }
.td-mission-title { flex: 1; font-size: 1.05rem; font-weight: 800; display: flex; flex-direction: column; }
.td-mission-title small { font-size: .78rem; color: var(--ink-2); font-weight: 700; }
.td-mission-reward { font-family: var(--font-display); font-weight: 900; font-size: 1.1rem; background: var(--butter); border: var(--line-thin) solid var(--ink); border-radius: var(--radius-pill); padding: 3px 10px; }
.td-mission--done { background: var(--mint-tint); } .td-mission--done .td-mission-check { background: var(--kid, var(--coral)); }
.td-mission--done .td-mission-title { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--ink-2); }
.td-mission--done .td-mission-reward { background: var(--card); }
.td-mission--pending { background: var(--butter-tint); border-style: dashed; } .td-mission--pending .td-mission-check { background: var(--butter); }
.td-mission--rejected { opacity: .5; box-shadow: none; }

/* ─── Jauge ─── */
.td-meter { display: flex; gap: 5px; flex: 1; min-width: 60px; }
.td-meter span { flex: 1; height: 12px; border-radius: var(--radius-pill); border: var(--line-thin) solid var(--ink); background: var(--track); }
.td-meter--kid span.on { background: var(--kid, var(--coral)); } .td-meter--butter span.on { background: var(--butter); } .td-meter--mint span.on { background: var(--mint); }
.td-meter:has(.td-meter-fill) { height: 14px; border: var(--line-thin) solid var(--ink); border-radius: var(--radius-pill); background: var(--track); overflow: hidden; gap: 0; }
.td-meter .td-meter-fill { flex: none; height: 100%; border: 0; border-right: var(--line-thin) solid var(--ink); border-radius: 0; background: var(--butter); }
.td-meter--mint .td-meter-fill { background: var(--mint); }

/* ─── Rareté ─── */
.td-rarity { display: inline-flex; align-items: center; gap: 4px; font-size: .68rem; white-space: nowrap; font-weight: 900; text-transform: uppercase; letter-spacing: .05em;
  padding: 2px 8px 2px 6px; border-radius: var(--radius-pill); border: var(--line-thin) solid var(--ink); background: var(--rarity-commun); }
.td-gems { display: inline-flex; gap: 1px; } .td-gems svg { fill: var(--ink); }
.td-rarity--rare { background: var(--rarity-rare); } .td-rarity--epique { background: var(--rarity-epique); }
.td-rarity--legendaire { background: var(--rarity-legendaire); box-shadow: 2px 2px 0 var(--ink); }

/* ─── Scène ─── */
.td-stage { position: relative; overflow: hidden; border: var(--line) solid var(--ink); border-radius: var(--radius-stage); box-shadow: var(--shadow); display: grid; place-items: end center; min-height: 120px; }
.td-stage-dots { position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .35) 2px, transparent 2.5px); background-size: 16px 16px; }
.td-scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.td-stage-figure { position: relative; padding-top: 10px; line-height: 0; }

/* ─── Personnage : vie ─── */
.td-chibi { display: block; overflow: visible; }
.td-chibi--crop { overflow: hidden; }
.td-chibi--alive .td-body { animation: td-breathe 3.2s ease-in-out infinite; transform-origin: 100px 230px; }
.td-chibi--alive .td-eye { animation: td-blink 5s infinite; }
.td-chibi--happy .td-body { animation: td-hop .5s cubic-bezier(.3, 1.6, .5, 1) 2; transform-origin: 100px 230px; }
.td-chibi--alive .td-bob { animation: td-bob 2.6s ease-in-out infinite; }
.td-chibi--alive .td-pet { animation: td-pet 1.8s ease-in-out infinite; transform-origin: 22px 40px; }
.td-chibi--alive .td-lights circle { animation: td-lights 1.2s steps(2) infinite; }
.td-chibi--alive .td-lights circle:nth-child(2) { animation-delay: .4s; } .td-chibi--alive .td-lights circle:nth-child(3) { animation-delay: .8s; }
.td-chibi--alive .td-flame { animation: td-flame .3s ease-in-out infinite alternate; }
.td-chibi--alive .td-sparkle, .td-chibi--alive .td-notes, .td-twinkle { animation: td-twinkle 1.6s ease-in-out infinite; }
.td-chibi--alive .td-wing-l { animation: td-wing-l 1.4s ease-in-out infinite; } .td-chibi--alive .td-wing-r { animation: td-wing-r 1.4s ease-in-out infinite; }
.td-chibi--alive .td-cape { animation: td-cape 2.4s ease-in-out infinite; }
.td-chibi--locked { filter: brightness(0); opacity: .18; }
@keyframes td-breathe { 50% { transform: scale(1.015, .985) } }
@keyframes td-blink { 0%, 92%, 100% { transform: scaleY(1) } 95% { transform: scaleY(.1) } }
@keyframes td-hop { 0%, 100% { transform: translateY(0) } 40% { transform: translateY(-16px) scale(.97, 1.04) } 70% { transform: scale(1.05, .95) } }
@keyframes td-bob { 50% { transform: translateY(-5px) rotate(2deg) } }
@keyframes td-pet { 0%, 100% { transform: translateY(0) } 30% { transform: translateY(-5px) scale(.96, 1.05) } 60% { transform: scale(1.04, .96) } }
@keyframes td-lights { 50% { opacity: .25 } }
@keyframes td-flame { to { transform: scaleX(1.25) } }
@keyframes td-twinkle { 50% { opacity: .35; transform: scale(.85) } }
@keyframes td-wing-l { 50% { transform: rotate(-8deg) } } @keyframes td-wing-r { 50% { transform: rotate(8deg) } }
@keyframes td-cape { 50% { transform: skewX(3deg) } }

/* ─── Onglets ─── */
.td-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 4px 10px; scrollbar-width: none; }
.td-tab { position: relative; padding: 8px 14px; border-radius: var(--radius-pill); border: var(--line) solid var(--ink); background: var(--card); font: inherit; font-weight: 900; font-size: .9rem; white-space: nowrap; color: var(--ink); cursor: pointer; }
.td-tab.on { background: var(--ink); color: var(--card); }
.td-tab-dot { position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; border-radius: 50%; background: var(--coral); border: var(--line-thin) solid var(--ink); }

/* ─── Objet de garde-robe ─── */
.td-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 8px 10px; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--card); border: var(--line) solid var(--ink); border-radius: var(--radius-mission); box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s; }
.td-item:hover { transform: translateY(-2px) rotate(-1deg); }
.td-item:active { transform: translate(3px, 3px); box-shadow: var(--shadow-none); }
.td-item-art { position: relative; width: 100%; height: 88px; display: grid; place-items: center; border-radius: var(--radius-md); background: var(--hover); overflow: hidden; }
.td-item-art .td-stage { width: 100%; height: 100%; min-height: 0; border-width: 0; border-radius: 0; box-shadow: none; }
.td-item--rare .td-item-art { background: var(--sky-tint); } .td-item--epique .td-item-art { background: var(--lilac-tint); } .td-item--legendaire .td-item-art { background: var(--butter-tint); }
.td-item-name { font-weight: 900; font-size: .85rem; text-align: center; line-height: 1.15; }
.td-item-how { font-size: .72rem; font-weight: 800; color: var(--ink-3); text-align: center; }
.td-item.is-equipped { background: var(--butter); box-shadow: var(--shadow-sm), 0 0 0 3px var(--card), 0 0 0 6px var(--ink); }
.td-item.is-locked { cursor: default; background: var(--paper); border-style: dashed; box-shadow: none; }
.td-item.is-locked:hover { transform: none; }
.td-item-lock { position: absolute; inset: 0; display: grid; place-items: center; }
.td-item-new { position: absolute; top: 4px; right: 4px; font-size: .65rem; font-weight: 900; background: var(--coral); border: var(--line-thin) solid var(--ink); border-radius: var(--radius-pill); padding: 1px 6px; rotate: 6deg; }
.td-item--legendaire:not(.is-locked) .td-item-art::after { content: ''; position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, .7) 50%, transparent 58%); animation: td-holo 3s ease-in-out infinite; }
@keyframes td-holo { from { transform: translateX(-60%) } to { transform: translateX(60%) } }

.td-wardrobe { display: grid; grid-template-columns: 260px 1fr; gap: 22px; align-items: start; }
.td-wardrobe-side { display: flex; flex-direction: column; gap: 14px; }
.td-wardrobe-side .td-stage { height: 320px; }
.td-collection { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 10px 14px; background: var(--card); border: var(--line) solid var(--ink); border-radius: var(--radius-mission); }
.td-collection span { font-size: .82rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.td-collection b { font-family: var(--font-display); font-size: 1.1rem; } .td-collection .td-meter { grid-column: 1 / -1; }
.td-item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; padding: 4px; }
@media (max-width: 560px) { .td-wardrobe { grid-template-columns: 1fr; } .td-wardrobe-side .td-stage { height: 280px; } }

/* ─── Quêtes ─── */
.td-questboard { display: flex; flex-direction: column; gap: 12px; padding: 18px; background: var(--card); border: var(--line) solid var(--ink); border-radius: var(--radius-sticker); box-shadow: var(--shadow); }
.td-questboard-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.td-streak { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: var(--radius-pill); border: var(--line-thin) solid var(--ink); background: var(--coral-tint); font-size: .9rem; }
.td-streak b { font-family: var(--font-display); font-size: 1.15rem; }
.td-seg { display: flex; border: var(--line) solid var(--ink); border-radius: var(--radius-pill); overflow: hidden; }
.td-seg button { flex: 1; padding: 9px; font: inherit; font-weight: 900; background: var(--card); color: var(--ink); border: 0; cursor: pointer; }
.td-seg button + button { border-left: var(--line) solid var(--ink); } .td-seg button.on { background: var(--ink); color: var(--card); }
.td-chestbar { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 4px 12px; align-items: center; padding: 10px 14px; border-radius: var(--radius-mission); border: var(--line-thin) dashed var(--ink); background: var(--butter-tint); }
.td-chestbar .td-chest { grid-row: 1 / 3; }
.td-chestbar-txt { display: flex; flex-direction: column; } .td-chestbar-txt b { font-family: var(--font-display); font-size: 1.1rem; } .td-chestbar-txt span { font-size: .8rem; color: var(--ink-2); }
.td-quests { display: flex; flex-direction: column; gap: 10px; }
.td-quest { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; background: var(--card); border: var(--line) solid var(--ink); border-radius: var(--radius-mission); box-shadow: var(--shadow-sm); }
.td-quest-ico { width: 46px; height: 46px; border-radius: var(--radius-md); border: var(--line) solid var(--ink); display: grid; place-items: center; font-size: 1.5rem; background: var(--butter-tint); rotate: -4deg; }
.td-quest--semaine .td-quest-ico { background: var(--mint-tint); }
.td-quest-title { font-weight: 900; font-size: 1rem; line-height: 1.2; } .td-quest-hint { font-size: .78rem; color: var(--ink-2); }
.td-quest-progress { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.td-quest-count { font-family: var(--font-display); font-weight: 900; font-size: .9rem; min-width: 32px; text-align: right; }
.td-quest-reward { display: inline-block; max-width: 110px; font-size: .75rem; font-weight: 900; text-align: center; line-height: 1.15; padding: 5px 8px; border-radius: var(--radius-md); border: var(--line-thin) dashed var(--ink); }
.td-quest.is-ready { background: var(--butter-tint); animation: td-ready 1.6s ease-in-out infinite; }
.td-quest.is-claimed { background: var(--paper); border-style: dashed; box-shadow: none; }
.td-quest.is-claimed .td-quest-title { color: var(--ink-2); text-decoration: line-through; text-decoration-thickness: 2px; }
.td-quest-done { font-weight: 900; color: var(--good-text); }
@keyframes td-ready { 50% { transform: rotate(-.6deg) scale(1.01) } }

/* ─── Coffre & révélation ─── */
.td-chest { overflow: visible; display: block; }
.td-chest--open .td-chest-lid { transform: rotate(-24deg) translate(-2px, -4px); }
.td-reveal { position: relative; display: grid; place-items: center; padding: 30px 16px; border-radius: var(--radius-sticker); overflow: hidden; background: var(--cloth-navy); border: var(--line) solid var(--ink); }
.td-reveal--jour { background: var(--coral); }
.td-reveal-rays { position: absolute; inset: -50%; background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .14) 0 10deg, transparent 10deg 20deg); animation: td-spin 18s linear infinite; }
@keyframes td-spin { to { transform: rotate(1turn) } }
.td-reveal-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 20px; width: min(470px, 100%);
  background: var(--card); border: var(--line) solid var(--ink); border-radius: var(--radius-sticker); box-shadow: var(--shadow-lg); animation: td-pop .35s cubic-bezier(.3, 1.5, .5, 1); }
.td-reveal-card .td-stage { width: 100%; }
.td-reveal-title { font-family: var(--font-display); font-weight: 900; font-size: 2.2rem; line-height: 1; margin: 4px 0 0; }
.td-reveal-sub { margin: 0; color: var(--ink-2); }
.td-reveal-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; width: 100%; margin-top: 6px; }
@keyframes td-pop { from { transform: scale(.85); opacity: 0 } }

/* ─── Carte enfant ─── */
.td-kidcard { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 0 0 16px; overflow: hidden; text-align: left; font: inherit; color: var(--ink); cursor: pointer; width: 260px; transition: transform .15s; }
.td-kidcard .td-stage { border-width: 0 0 var(--line) 0; border-radius: 0; box-shadow: none; }
.td-kidcard:hover { transform: translateY(-3px); }
.td-kidcard-foot { display: flex; align-items: center; justify-content: space-between; padding: 8px 18px 0; }
.td-kidcard-name { font-family: var(--font-display); font-weight: 900; font-size: 1.7rem; }
.td-kidcard-sub { padding: 0 18px; font-size: .9rem; color: var(--ink-2); }
.td-kidcard .td-meter { padding: 0 18px; }
.td-badge { position: absolute; top: 12px; right: 12px; background: var(--card); border: var(--line-thin) solid var(--ink); border-radius: var(--radius-pill); padding: 3px 10px; font-size: .8rem; font-weight: 900; }
.td-badge--live { animation: td-pulse 1.4s ease-in-out infinite; }
@keyframes td-pulse { 50% { transform: scale(1.06) } }

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

/* ─── Pastilles de couleur, onglet « Moi » ─── */
.td-lbl { display: block; font-size: .82rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 16px 0 8px; }
.td-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.td-swatch { width: 36px; height: 36px; border-radius: 50%; border: var(--line) solid var(--ink); cursor: pointer; padding: 0; transition: transform .12s; }
.td-swatch:hover { transform: scale(1.08); }
.td-swatch.on { transform: scale(1.12); box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--ink); }
.td-item-grid--sm { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }

/* ─── Vague 2 : effets ─── */
.td-chibi--alive .td-float { animation: td-float 3s ease-in-out infinite; }
.td-chibi--alive .td-spin { animation: td-spin 8s linear infinite; }
.td-chibi--alive .td-aura { animation: td-aura 2.4s ease-in-out infinite; }
.td-chibi--alive .td-tail { animation: td-tail 1.6s ease-in-out infinite; }
.td-chibi--alive .td-eye-pop { animation: td-eye-pop 1.2s ease-in-out infinite; }
@keyframes td-float { 0%, 100% { transform: translateY(0); opacity: 1 } 50% { transform: translateY(-8px); opacity: .7 } }
@keyframes td-aura { 50% { transform: scale(1.04); opacity: .8 } }
@keyframes td-tail { 50% { transform: rotate(-6deg) } }
@keyframes td-eye-pop { 50% { transform: scale(1.12) } }

/* ─── Coffres v2 (1 par semaine, 1 super coffre par mois) ─── */
.td-chestbar { grid-template-columns: auto 1fr auto; }
.td-chestbar .td-meter { grid-column: 2 / 4; }
.td-chestbar--super { background: var(--lilac-tint); }
.td-chestbar.is-ready { border-style: solid; box-shadow: var(--shadow-sm); animation: td-ready 1.6s ease-in-out infinite; }
.td-chestbar-count { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-display); font-weight: 900; font-size: 1.05rem; }
.td-reveal--semaine { background: var(--coral); }
.td-reveal--mois { background: var(--cloth-navy); }
.td-quest-done { display: inline-flex; align-items: center; gap: 3px; }
