/* ===================================================================
   STYLES.CSS - VERSION NETTOYÉE ET OPTIMISÉE
   ================================================================ */

/* ===== 1. RESET & TOKENS ===== */
* { 
  box-sizing: border-box; 
}

html, body { 
  margin: 0; 
  padding: 0; 
}

:root {
  /* Couleurs */
  --bg: #0f1220;
  --panel: #171a2b;
  --muted: #9aa0b5;
  --line: #22263a;
  --text: #eef1ff;
  --accent: #6c63ff;
  --accent-2: #22c55e;
  
  /* Espacements */
  --gap: 12px;
  --gap-lg: 16px;
  
  /* Bordures & ombres */
  --radius: 16px;
  --shadow: 0 8px 20px rgba(0, 0, 0, .25);
  
  /* Dimensions */
  --nav-h: 56px;
  --sidebar-w: 250px;
}

body { 
  background: var(--bg);
  color: var(--text);
  font: 500 16px/1.4 system-ui, -apple-system, Segoe UI, Roboto;
}

/* Supprimer les soulignés globalement */
h1, h2, h3, h4, h5, h6,
a, button, .tile, .quick__btn, .name {
  text-decoration: none !important;
}


/* ===== 2. LAYOUT PRINCIPAL ===== */
.app { 
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 0 var(--sidebar-w) 1fr;
}

.sidebar { 
  grid-column: 2;
  background: #0b0e1a;
  border-right: 1px solid var(--line);
  padding: 12px;
}

.page { 
  grid-column: 3;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.main {
  padding: var(--gap);
  display: grid;
  gap: var(--gap);
}

.main-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}


/* ===== 3. NAVIGATION ===== */

/* Sidebar Menu */
.menu { 
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu__link { 
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: #cbd3ff;
  transition: background 0.2s;
}

.menu__link:hover { 
  background: #13172a;
}

.menu__link.is-active { 
  background: var(--accent);
  color: #fff;
}

/* Hamburger Button */
.hamburger { 
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: #222842;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s;
}

.hamburger:active {
  transform: scale(0.95);
}

.hamburger span { 
  display: block;
  width: 20px;
  height: 2px;
  background: #cbd3ff;
  margin: 3px 0;
}

/* Tab Bar (Mobile Bottom Navigation) */
.tabbar { 
  position: sticky;
  bottom: 0;
  background: #0b0e1a;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: var(--nav-h);
}

.tabbar__btn { 
  display: grid;
  place-items: center;
  color: #a6add0;
  font-size: 12px;
  transition: color 0.2s;
}

.tabbar__btn.is-active { 
  color: #fff;
}

.tabbar__btn span { 
  display: block;
  font-size: 11px;
}


/* ===== 4. HEADER ===== */
.header { 
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px var(--gap-lg);
  border-bottom: 1px solid var(--line);
}

.brand { 
  margin: 0;
  font-size: 18px;
  letter-spacing: .2px;
}

.stats { 
  display: flex;
  gap: 10px;
  align-items: center;
}

.stat { 
  display: flex;
  align-items: center;
  gap: 6px;
  background: #222842;
  padding: 6px 10px;
  border-radius: 999px;
  color: #cbd3ff;
  font-size: 14px;
  white-space: nowrap;
}

.stat--pulse {
  position: relative;
}

.stat--pulse::after {
  content: "+1";
  position: absolute;
  right: -6px;
  top: -6px;
  font-weight: 700;
  font-size: .7rem;
  background: #22c55e;
  color: #062e0e;
  padding: 2px 5px;
  border-radius: 999px;
  transform: scale(.8);
  opacity: 0;
  animation: ph-bump .8s ease-out forwards;
}


/* ===== 5. CARTES PRINCIPALES (Home) ===== */
.hero { 
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  padding: var(--gap);
}

.card { 
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  border: 1px solid var(--line);
  max-width: 350px;
  margin: 0 auto;
}

.card__title { 
  margin-top: 8px;
  color: #cbd3ff;
  font-weight: 600;
}

.card-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  justify-content: center;
}

/* Maison */
.house img { 
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
}

.house__img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: #0b0e1a;
  display: block;
}

/* Avatar + Compagnon */
.avatar__wrap { 
  position: relative;
  display: grid;
  place-items: center;
  padding: 8px;
}

.avatar__img { 
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.companion { 
  position: absolute;
  right: 12px;
  bottom: 8px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #0b0e1a;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
}

.companion__img { 
  width: 46px;
  height: 46px;
  object-fit: contain;
}

/* Noms (boutons renommage) */
.names { 
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
  flex-wrap: wrap;
}

.name { 
  background: #222842;
  color: #cbd3ff;
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.name:hover {
  background: #2a3050;
}

.level { 
  text-align: center;
  margin-top: 6px;
  color: #9fb0ff;
}


/* ===== 6. TILES & QUICK ACTIONS ===== */
.tiles { 
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

.tile { 
  text-align: left;
  background: #222842;
  border: 0;
  border-radius: 16px;
  padding: 14px;
  color: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, .3);
}

.tile__title { 
  font-weight: 700;
  margin-bottom: 6px;
}

.tile__sub { 
  color: #cbd3ff;
}

.quick { 
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

.quick__btn { 
  text-align: center;
  background: var(--panel);
  padding: 12px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s;
}

.quick__btn:hover {
  transform: translateY(-2px);
}


/* ===== 7. BOUTONS ===== */
.btn { 
  background: #222842;
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: filter 0.2s, transform 0.2s;
}

.btn:hover {
  filter: brightness(1.1);
}

.btn:active {
  transform: scale(0.98);
}

.btn--accent { 
  background: var(--accent);
}

.btn--ghost { 
  background: transparent;
  border: 1px solid var(--line);
  color: #cbd3ff;
}

.btn[disabled] { 
  opacity: .5;
  cursor: not-allowed;
}

.btn[disabled]:hover {
  filter: none;
  transform: none;
}


/* ===== 8. PAGE HEAD ===== */
.page-head { 
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 4px 4px;
}

.page-head__left { 
  display: flex;
  flex-direction: column;
}

.page-title { 
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .2px;
}

.page-sub { 
  color: var(--muted);
}

.pill { 
  background: #222842;
  color: #cbd3ff;
  border-radius: 999px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}


/* ===== 9. ACTIONS BAR & FILTERS ===== */
.actions { 
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
}

.filters { 
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px var(--gap);
  align-items: center;
}


/* ===== 10. TÂCHES (Réussites) ===== */
.task-list { 
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 4px;
}

.task { 
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  padding: 12px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  transition: outline 0.2s;
}

.task input { 
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
}

.task__check {
  width: 24px;
  height: 24px;
}

.task__text { 
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.task__name { 
  font-weight: 600;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.task__xp { 
  color: #9fb0ff;
  font-weight: 600;
  opacity: .8;
  font-size: .95rem;
  white-space: nowrap;
}

.task.is-done { 
  outline: 1px solid #2e3658;
  opacity: .95;
}

.task-footer { 
  position: sticky;
  bottom: calc(var(--nav-h) + 8px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px;
  background: linear-gradient(to top, rgba(15, 18, 32, .9), rgba(15, 18, 32, .6) 60%, transparent);
  border-radius: 12px;
  backdrop-filter: blur(6px);
}


/* ===== 11. RÉUSSITES ===== */
.rs-list { 
  display: grid;
  gap: 12px;
}

.rs-item { 
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.rs-item__toggle { 
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid #3b3f62;
  background: #0b0e1a;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: .15s ease;
}

.rs-item__toggle:checked { 
  background: var(--accent);
  border-color: var(--accent);
}

.rs-item__label { 
  flex: 1;
  color: var(--text);
}

.rs-item__xp { 
  font-weight: 700;
  color: #cbd3ff;
}


/* ===== 12. PROGRESS BARS ===== */
.progress { 
  background: #1a1f35;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #2a2e42;
}

.progress__bar { 
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #8b86ff);
  transition: width .25s ease;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  transition: width 0.3s ease;
}

.progress-text {
  display: block;
  text-align: center;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 8px;
}


/* ===== 13. INPUTS ===== */
.date-input { 
  background: #222842;
  color: #fff;
  border: 1px solid #2a2e42;
  border-radius: 10px;
  padding: 6px 10px;
}

.stepper { 
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px;
  background: #1b2138;
  padding: 6px 8px;
  border-radius: 999px;
}

.stepper__btn { 
  background: #222842;
  border: 0;
  border-radius: 8px;
  width: 28px;
  height: 28px;
  line-height: 28px;
  font-size: 18px;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}

.stepper__btn:hover {
  background: #2a3050;
}

.stepper__val { 
  min-width: 20px;
  text-align: center;
  font-weight: 700;
}

.adder {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.adder__count {
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.adder__btn {
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  width: 28px;
  height: 28px;
  line-height: 28px;
  font-size: 18px;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}

.adder__btn:hover {
  background: #7a71ff;
}


/* ===== 14. MODALE ===== */
.modal { 
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  padding: 16px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal.show { 
  display: flex;
}

.modal__panel { 
  width: min(720px, 92vw);
  max-height: 92dvh;
  background: #0b0e1a;
  border: 1px solid #232744;
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal__head { 
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #232744;
}

.modal__body { 
  padding: 12px 14px;
  display: block;
  overflow: auto;
  flex: 1 1 auto;
}

.logline { 
  padding: 10px;
  background: #171a2b;
  border-radius: 10px;
  color: #d7dcff;
}


/* ===== 15. TROPHÉES ===== */
.trophies-wrap { 
  display: grid;
  gap: 12px;
  padding: var(--gap);
  background: transparent;
  margin: 2rem 0;
}

.trophies-head { 
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.trophies-title { 
  margin: 0;
  font-size: 18px;
  letter-spacing: .2px;
  font-weight: 700;
}

.trophies-grid { 
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.trophy { 
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  border: 1px solid var(--line);
  transition: transform 0.2s;
}

.trophy:hover {
  transform: translateY(-2px);
}

.trophy__img { 
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
  background: #0b0e1a;
}

.trophy__text { 
  display: grid;
  gap: 2px;
}

.trophy__name { 
  font-weight: 700;
}

.trophy__desc { 
  color: #aeb6db;
  font-size: 13px;
}

.trophies-empty { 
  text-align: center;
  color: #aeb6db;
  background: #0b0e1a;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 16px;
}

/* Trophy Cards (Badges page) */
.trophy-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  border: 2px solid rgba(255, 215, 0, 0.3);
  transition: all 0.3s ease;
  cursor: pointer;
}

.trophy-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 215, 0, 0.6);
  box-shadow: 0 8px 20px rgba(255, 215, 0, 0.2);
}

.trophy-card.is-locked .shop-card__img {
  opacity: 0.3;
  filter: grayscale(100%);
}

.trophy-card.is-owned .shop-card__img {
  opacity: 1;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
}

.trophy-card__img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.3));
}

.trophy-card__name {
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  color: #ffd700;
  line-height: 1.3;
}


/* ===== 16. BOUTIQUE ===== */

/* Filtres et onglets */
.seg { 
  display: flex;
  gap: 6px;
  overflow: auto;
  padding: 4px var(--gap);
  flex-wrap: wrap;
}

.seg::-webkit-scrollbar { 
  display: none;
}

.seg__btn { 
  background: #1b2138;
  color: #cbd3ff;
  border: 1px solid #232744;
  padding: 8px 10px;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.seg__btn:hover {
  background: #232744;
}

.seg__btn.is-active { 
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

/* Grille des cartes */
.shop-grid { 
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  padding: var(--gap);
}

/* Structure de carte boutique */
.shop-card { 
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.shop-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, .3);
}

/* En-tête : icône de rareté + nom côte à côte */
.shop-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.shop-card__rarity {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.shop-card__title {
  font-weight: 700;
  font-size: 14px;
  flex: 1;
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
  min-width: 0;
  max-width: 100%;
}

/* Corps : image à gauche, infos à droite */
.shop-card__body {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  align-items: center;
}

.shop-card__img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  background: #0b0e1a;
  border-radius: 10px;
}

.shop-card__info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shop-card__meta {
  color: #9fb0ff;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Bouton d'action en bas */
.shop-card__cta {
  display: flex;
  width: 100%;
  gap: 8px;
}

.shop-card__cta .btn {
  flex: 1;
  padding: 10px 12px;
  font-size: 14px;
}

/* États des cartes */
.shop-card.is-owned {
  outline: 1px solid #2e3658;
}

.shop-card.is-owned .shop-card__title {
  color: #9fb0ff;
}

.shop-card.is-locked {
  opacity: .9;
}

.shop-card.is-locked .shop-card__img {
  filter: grayscale(1) brightness(.8);
  opacity: .6;
}

.shop-card.is-locked .shop-card__title {
  color: var(--muted);
}

.shop-card.is-locked .shop-card__meta .price {
  opacity: .75;
}

/* Variantes de rareté */
.shop-card.rarity-rare {
  border-color: #60a5fa;
}

.shop-card.rarity-mythique {
  border-color: #fbbf24;
}

/* Badges de prix */
.price {
  background: #222842;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 13px;
  display: inline-block;
}

.owned {
  background: #1a2a1f;
  color: #b9f3c8;
  border: 1px solid #2a6441;
}

.invisible-badge {
  background: #3a2a1f;
  color: #ffd7a8;
  border: 1px dashed #654321;
}

/* Cartes défis (layout spécial) */
.shop-card--defi {
  grid-template-columns: 88px 1fr auto;
  align-items: stretch;
}

.shop-card--defi .shop-card__cta {
  display: grid;
  align-content: center;
  justify-items: end;
  gap: 8px;
  padding-left: 8px;
  min-width: 140px;
}


/* ===== 17. DÉFIS & COLLECTIONS ===== */
.defi-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
}

.defi-progress {
  max-width: 380px;
}

.defi-checklist {
  max-width: 100%;
}

.collection-wrap {
  display: grid;
  gap: 12px;
  padding: 4px;
}

.collection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.collection-title {
  margin: 0;
  font-size: 18px;
  letter-spacing: .2px;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.coll-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px;
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
  min-width: 0;
  transition: transform 0.2s;
}

.coll-item:hover {
  transform: translateY(-2px);
}

.coll-item__img {
  width: 100%;
  height: 84px;
  object-fit: contain;
  background: #0b0e1a;
  border-radius: 10px;
}

.coll-item__name {
  font-weight: 700;
  font-size: 14px;
}

.coll-item__tagline {
  color: var(--muted);
  font-size: 12px;
}

/* États verrouillés */
.coll--gray {
  filter: grayscale(1);
  opacity: .6;
}

.coll--gray .coll-item__img {
  filter: grayscale(1) brightness(.85);
  opacity: .85;
}

.coll--blur {
  filter: blur(2px) grayscale(.8);
  opacity: .75;
}

.coll--blur .coll-item__img {
  filter: blur(2px) brightness(.9);
  opacity: .9;
}


/* ===== 18. BADGES VISUELS ===== */
.visual-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin: 12px 0 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
}

.mini-badge {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 50%;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.mini-badge.earned {
  opacity: 1;
  filter: drop-shadow(0 2px 6px rgba(255, 215, 0, 0.4));
  border-color: #ffd700;
}

.mini-badge.locked {
  opacity: 0.25;
  filter: grayscale(100%) brightness(0.6);
}

.badge-count {
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  color: #cbd3ff;
  margin-top: 4px;
}


/* ===== 19. LIVRE (Tomes) ===== */
.book-content {
  max-width: 72ch;
  margin: var(--space-6, 24px) auto;
  padding: 0 var(--space-4, 16px);
}

.book-title {
  font-size: clamp(1.6rem, 2.2vw + 1rem, 2.2rem);
  line-height: 1.2;
  margin: 0 0 0.75em 0;
}

.book-content p {
  line-height: 1.7;
  margin: 0 0 1em 0;
}

.book-content .media,
.book-content figure {
  margin: 1.25rem auto;
  text-align: center;
}

.book-content img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: min(720px, 92vw);
  height: auto;
  border-radius: 12px;
}

.book-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.1));
}


/* ===== 20. BANNER DE CONSTRUCTION ===== */
.construction-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #1a2332 0%, #222842 100%);
  border: 2px dashed #3b4463;
  border-radius: 16px;
  padding: 20px;
  margin: 0 4px 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
}

.construction-icon {
  font-size: 48px;
  animation: construction-bounce 2s ease-in-out infinite;
}

.construction-text {
  flex: 1;
  color: #cbd3ff;
}

.construction-text strong {
  display: block;
  color: #fff;
  font-size: 18px;
  margin-bottom: 8px;
}

.construction-text p {
  margin: 0;
  color: #9fb0ff;
  line-height: 1.5;
}


/* ===== 21. ANIMATIONS ===== */

/* Toast */
.toast {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  animation: toast-pop 0.25s ease-out;
}

#toasts {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 110;
}

.toast {
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, .9);
  color: #e2e8f0;
  backdrop-filter: blur(4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  font-weight: 600;
  opacity: 0;
  transform: translateY(10px);
  animation: toast-in .25s ease-out forwards;
}

.toast.out {
  animation: toast-out .25s ease-in forwards;
}

/* Floaty (+XP gains) */
.floaty {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  z-index: 50;
  animation: floatyUp 900ms ease-out forwards;
}

.floaty--gain {
  color: #22c55e;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

.burst-chip {
  color: #4CAF50;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
  font-size: 0.9rem;
  pointer-events: none;
  user-select: none;
}

/* Badge célébration */
.badge-celebrate {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
}

.badge-confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6) rotate(0deg);
  animation: confetti-pop 900ms ease-out forwards;
}

.badge-pulse {
  animation: cardPulse 600ms ease-out;
}


/* ===== 22. UTILITAIRES ===== */
.tag {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  color: #9fb0ff;
  margin-left: 6px;
}

.muted {
  color: #a6add0;
  font-size: 12px;
}

.muted-empty {
  color: #94a3b8;
  opacity: .85;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 2px;
  padding: 0;
  list-style: none;
}

.chip-list li {
  margin: 0;
  padding: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: .9rem;
  background: rgba(148, 163, 184, .15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, .25);
}

.chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #22c55e;
}


/* ===== 23. KEYFRAMES ===== */
@keyframes toast-pop {
  from { transform: translateX(-50%) scale(0.9); opacity: 0; }
  to   { transform: translateX(-50%) scale(1);   opacity: 1; }
}

@keyframes toast-in {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(10px); }
}

@keyframes floatyUp {
  0%   { transform: translate(-50%, 0); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translate(-50%, -60px); opacity: 0; }
}

@keyframes confetti-pop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.6) rotate(0deg); }
  10%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.1) rotate(360deg); }
}

@keyframes cardPulse {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes ph-bump {
  0%   { opacity: 0; transform: scale(.6) translateY(-4px); }
  20%  { opacity: 1; transform: scale(1) translateY(0); }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: scale(.6) translateY(-4px); }
}

@keyframes construction-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}


/* ===== 24. MODE CLAIR ===== */
body.light-mode {
  /* Tokens mode clair */
  --bg: #f5f7fa;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #3b82f6;
  --accent-2: #10b981;
  --shadow: 0 8px 20px rgba(0, 0, 0, .08);
  
  background: var(--bg);
  color: var(--text);
}

/* Composants en mode clair */
body.light-mode .stat,
body.light-mode .hamburger,
body.light-mode .name,
body.light-mode .tile,
body.light-mode .pill,
body.light-mode .price,
body.light-mode .stepper,
body.light-mode .date-input,
body.light-mode .quick__btn {
  background: #e5e7eb !important;
  color: #111 !important;
  border-color: #d1d5db !important;
}

body.light-mode .card,
body.light-mode .task,
body.light-mode .rs-item,
body.light-mode .trophy,
body.light-mode .shop-card,
body.light-mode .coll-item {
  background: #ffffff !important;
  color: #111 !important;
  border: 1px solid #e5e7eb !important;
}

body.light-mode .card__title,
body.light-mode .task__xp,
body.light-mode .rs-item__xp,
body.light-mode .tile__sub {
  color: #555 !important;
}

body.light-mode .modal__panel,
body.light-mode .logline,
body.light-mode .shop-card__img,
body.light-mode .coll-item__img,
body.light-mode .companion {
  background: #f9fafb !important;
  color: #111 !important;
}

/* Sidebar & Tabbar en mode clair */
body.light-mode .sidebar {
  background: #ffffff !important;
  border-right: 1px solid #e5e7eb !important;
}

body.light-mode .menu__link {
  color: #374151 !important;
}

body.light-mode .menu__link:hover {
  background: #f3f4f6 !important;
}

body.light-mode .menu__link.is-active {
  background: #3b82f6 !important;
  color: #ffffff !important;
}

body.light-mode .tabbar {
  background: #ffffff !important;
  border-top: 1px solid #e5e7eb !important;
}

body.light-mode .tabbar__btn {
  color: #6b7280 !important;
}

body.light-mode .tabbar__btn.is-active {
  color: #111827 !important;
  font-weight: 700;
}

body.light-mode .hamburger span {
  background: #374151 !important;
}

body.light-mode .hamburger {
  background: #e5e7eb !important;
}

/* Onglets en mode clair */
body.light-mode .seg__btn,
body.light-mode .pill {
  background: #e5e7eb !important;
  color: #111 !important;
  border: 1px solid #d1d5db !important;
}

body.light-mode .seg__btn.is-active,
body.light-mode .pill.is-active {
  background: #3b82f6 !important;
  color: #fff !important;
  border-color: transparent !important;
}

body.light-mode .btn {
  background: var(--accent);
  color: #fff;
}

body.light-mode .btn:hover {
  filter: brightness(0.95);
}

body.light-mode .btn--ghost {
  background: #f9fafb;
  color: #111827;
  border: 1px solid var(--line);
}

body.light-mode .progress {
  background: #e5e7eb;
  border-color: #e5e7eb;
}

body.light-mode .progress__bar {
  background: linear-gradient(90deg, var(--accent), #60a5fa);
}

/* Autres éléments mode clair */
body.light-mode .construction-banner {
  background: linear-gradient(135deg, #e5e7eb 0%, #f3f4f6 100%);
  border-color: #d1d5db;
}

body.light-mode .construction-text {
  color: #374151;
}

body.light-mode .construction-text strong {
  color: #111827;
}

body.light-mode .construction-text p {
  color: #6b7280;
}

body.light-mode .visual-badges {
  background: rgba(0, 0, 0, 0.05);
}

body.light-mode .badge-count {
  color: #374151;
}

body.light-mode .trophy-card {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(255, 165, 0, 0.3);
}

body.light-mode .trophy-card:hover {
  border-color: rgba(255, 165, 0, 0.6);
  box-shadow: 0 8px 20px rgba(255, 165, 0, 0.2);
}

body.light-mode .trophy-card__name {
  color: #ff8c00;
}


/* ===== 25. RESPONSIVE - DESKTOP (> 900px) ===== */
@media (min-width: 900px) {
  .task-list {
    grid-template-columns: 1fr 1fr;
  }
  
  .trophies-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


/* ===== 26. RESPONSIVE - MOBILE (< 900px) ===== */
@media (max-width: 900px) {
  /* Layout mobile : sidebar cachée */
  .app {
    grid-template-columns: 0 0 1fr;
  }
  
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 20;
  }
  
  .app.is-open .sidebar {
    transform: translateX(0);
  }
  
  .app.is-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 10;
  }
  
  /* Grilles en 1 colonne */
  .hero,
  .tiles,
  .quick {
    grid-template-columns: 1fr;
  }
}


/* ===== 27. RESPONSIVE - MOBILE (< 600px) ===== */
@media (max-width: 600px) {
  /* Layout général */
  * {
    min-width: 0;
  }
  
  html, body, .app, .page {
    overflow-x: hidden;
  }
  
  .page {
    padding-inline: 8px;
  }
  
  .main-content {
    max-width: 100%;
    padding: 0 8px;
  }
  
  /* Grilles forcées en 1 colonne */
  .hero,
  .tiles,
  .quick,
  .trophies-grid,
  .card-container {
    grid-template-columns: 1fr !important;
  }
  
  /* Header compact */
  .header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px;
  }
  
  .hamburger {
    width: 38px;
    height: 38px;
  }
  
  .brand {
    flex: 1 1 auto;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .stats {
    width: 100%;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  
  .stat {
    padding: 4px 8px;
    font-size: 12px;
  }
  
  /* Boutique mobile */
  .filters,
  .seg {
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
    overflow: visible;
    flex-wrap: wrap;
    row-gap: 8px;
  }
  
  .shop-grid {
    grid-template-columns: 1fr;
    padding: 8px 0 72px;
    gap: 10px;
  }
  
  .shop-card {
    padding: 10px;
  }
  
  .shop-card__body {
    grid-template-columns: 70px 1fr;
    gap: 10px;
  }
  
  .shop-card__img {
    width: 70px;
    height: 70px;
  }
  
  .shop-card__title {
    font-size: 13px;
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
    min-width: 0;
    max-width: 100%;
  }
  
  .shop-card__header {
    min-width: 0;
    max-width: 100%;
  }
  
  .shop-card__rarity {
    flex-shrink: 0;
  }
  
  /* Cartes défis en mobile */
  .shop-card--defi {
    grid-template-columns: 72px 1fr;
  }
  
  .shop-card--defi .shop-card__cta {
    justify-items: stretch;
    grid-column: 1 / -1;
  }
  
  .tabbar {
    padding-bottom: env(safe-area-inset-bottom);
  }
  
  /* Collections */
  .collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  /* Badges visuels */
  .mini-badge {
    width: 36px;
    height: 36px;
  }
  
  .visual-badges {
    gap: 4px;
    padding: 6px;
  }
  
  /* Trophy cards */
  .trophy-card {
    padding: 0.75rem;
  }
  
  .trophy-card__img {
    width: 60px;
    height: 60px;
  }
  
  .trophy-card__name {
    font-size: 0.75rem;
  }
  
  .trophies-title {
    font-size: 1.25rem;
  }
  
  /* Banner construction */
  .construction-banner {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  
  .construction-icon {
    font-size: 36px;
  }
  
  /* Modal */
  .modal__panel {
    width: 96vw;
    max-height: 92dvh;
  }
}


/* ===== 28. RESPONSIVE - TRÈS PETIT (< 480px) ===== */
@media (max-width: 480px) {
  .collection-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .trophy-card {
    padding: 0.5rem;
  }
  
  .trophy-card__img {
    width: 50px;
    height: 50px;
  }
  
  .trophy-card__name {
    font-size: 0.7rem;
  }
}


/* ===== FIN DU FICHIER ===== */
