/* Lot 3 — Refonte visuelle de l'onglet Bord (d'après maquettes/Tableau-de-bord-RPG-La-Bordure.png) */

.bord-grille .avec-fleche::after {
  content: "\00a0→";
}

/* Accueil avec portrait du capitaine */
.bord-accueil {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.9rem;
}

.bord-portrait {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--or-bord, rgba(212, 166, 74, 0.55));
  background: var(--fond-nuit, #0a0f18);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.bord-accueil-texte {
  min-width: 0;
}

.bord-accueil-texte h2 {
  margin: 0 0 0.2rem;
}

.bord-visite {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

.ic-inline {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  opacity: 0.78;
}

/* Pendant ton absence : illustration fondue + pastilles colorées */
.bord-absence.carte-fond-illustre {
  padding-top: 1rem;
}

.bord-absence.carte-fond-illustre > :not(.carte-fond-img) {
  position: relative;
  z-index: 1;
}

.bord-absence .carte-titre-ic {
  margin-bottom: 0.65rem;
}

.bord-absence .compte-a-lire {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: rgba(212, 166, 74, 0.16);
  border: 1px solid rgba(212, 166, 74, 0.45);
  color: var(--or-vif, #f2cf83);
}

.bord-faits li {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.45rem 0.65rem;
  padding: 0.55rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.bord-faits li:first-child {
  border-top: 0;
  padding-top: 0.1rem;
}

.bord-fait {
  flex: 1 1 200px;
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

/* En cours */
.bord-cours .carte-titre-ic {
  margin-bottom: 0.65rem;
}

.bord-encours {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.bord-ligne {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.3rem 0.75rem;
}

.bord-note-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.55rem;
  margin-bottom: 0;
}

/* Ton vaisseau, Ton équipage, Dans la Bordure */
.bord-vaisseau .carte-titre-ic,
.bord-equipage .carte-titre-ic,
.bord-bordure .carte-titre-ic {
  margin-bottom: 0.65rem;
}

.bord-vaisseau-tete {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.55rem;
}

.bord-vaisseau-img {
  width: 82px;
  height: 62px;
  flex: 0 0 82px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(212, 166, 74, 0.28);
  background: var(--fond-nuit, #0a0f18);
}

.bord-vaisseau-tete > div {
  min-width: 0;
}

.bord-pieces li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem 0.6rem;
}

.bord-equipage-corps,
.bord-bordure-corps {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 0.45rem;
}

.bord-equipage-corps > ul,
.bord-bordure-corps > div {
  flex: 1 1 0;
  min-width: 0;
}

.bord-bordure-corps p {
  margin: 0 0 0.4rem;
}

.bord-bordure-corps p:last-child {
  margin-bottom: 0;
}

/* Chapitre en cours : étapes cochées et étape active */
.objectif .puces {
  gap: 0;
}

/* lignes séparées par de simples filets ; l'étape en cours reçoit un cadre doré */
.objectif .puces li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 38px;
  padding: 0.4rem 0.5rem;
  border: 1px solid transparent;
  border-bottom-color: rgba(212, 169, 87, 0.2);
  border-radius: 0;
  background: none;
}

.objectif .puces li:last-child {
  border-bottom-color: transparent;
}

.objectif .puces li.en-cours {
  border-color: var(--or);
  border-radius: 8px;
  background: rgba(212, 166, 74, 0.1);
}

/* Colonne droite : prochain pack + Ta main */
.bord-pack-prochain {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  margin: 0 0 0.85rem;
  border-radius: var(--rayon, 12px);
  border: 1px solid var(--or-bord, rgba(212, 166, 74, 0.25));
  background: linear-gradient(155deg, rgba(21, 28, 41, 0.92), rgba(14, 19, 29, 0.92));
}

.bord-pack-prochain-img {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(212, 166, 74, 0.35);
}

.bord-pack-prochain-corps {
  margin: 0;
  min-width: 0;
}

.bord-main .carte-titre-ic {
  margin-bottom: 0.65rem;
}

.bord-main .carte-pack-main {
  border-radius: var(--rayon, 12px);
  padding: 0.75rem 0.85rem;
  background: linear-gradient(160deg, rgba(20, 27, 40, 0.96), rgba(11, 16, 25, 0.96));
}

.bord-main .carte-pack-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.bord-main .carte-pack-main .rangee {
  justify-content: flex-end;
  margin-top: 0.45rem;
}

@media (min-width: 1200px) {
  .bord-col-p .main-cartes-grille {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .bord-grille,
  .bord-grille > *,
  .bord-col-p,
  .bord-col-g,
  .bord-col-d,
  .bord-bas,
  .bord-absence,
  .bord-vaisseau,
  .bord-equipage,
  .bord-bordure,
  .bord-main {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .bord-equipage-corps,
  .bord-bordure-corps {
    flex-direction: column;
    gap: 0.6rem;
  }

  .bord-grille button,
  .bord-grille .bouton,
  .bord-grille .bouton-sombre,
  .bord-grille .bouton-or {
    min-height: 44px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .bord-accueil {
    margin-bottom: 0.5rem;
    gap: 0.65rem;
  }

  .bord-portrait {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .bord-grille button,
  .bord-grille .bouton,
  .bord-grille .bouton-sombre,
  .bord-grille .bouton-or {
    min-height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bord-grille * {
    transition: none !important;
    animation: none !important;
  }
}

@media (forced-colors: active) {
  .bord-pack-prochain,
  .objectif .puces li,
  .bord-portrait {
    border: 1px solid CanvasText;
  }
}

/* Le pack du jour : un paquet moins haut, au milieu de sa carte, et son bouton centré */
.bord-pack .paquet-scene { margin: 6px 0; }
.bord-pack .paquet-3d { width: 128px; height: 178px; }
.bord-pack > .rangee { justify-content: center; }
@media (max-width: 600px) {
  .bord-pack .paquet-3d { width: 150px; height: 208px; }
}

/* Une carte jouée qui attend son occasion : une ligne sobre, à filet doré (Bord, comptoir, fiches d'histoire et d'expédition). */
.carte-en-jeu {
  min-width: 0;
  overflow-wrap: anywhere;
}

p.carte-en-jeu {
  margin: 0.5rem 0;
  padding: 0.35rem 0.7rem;
  border-left: 3px solid var(--or, #d4a957);
  border-radius: 0 8px 8px 0;
  background: rgba(212, 169, 87, 0.07);
  font-size: 0.9rem;
}

.carte-en-jeu b {
  color: var(--or-clair, #f0d797);
  font-weight: 600;
}

.carte-en-jeu-ici {
  color: var(--texte-doux);
}

/* ---------- Disposition d'après la maquette (ordinateur, 1200 px et plus) : trois colonnes inégales ----------
   Gauche large : absence, en cours, puis vaisseau à côté de l'équipage et de la Bordure. Centre : le but du chapitre et la dette.
   Droite : le pack du jour, « Ta main », le savoir-faire. Chaque colonne est empilée d'un bloc : pas de trous entre les rangées.
   Le DOM garde l'ordre du téléphone ; en dessous de 1200 px, la colonne du centre n'est qu'un emballage transparent. */
.bord-col-c { display: contents; }
@media (min-width: 1200px) {
  #panneau-bord .bord-grille:not(.premiere) {
    grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr) minmax(0, 0.95fr);
    grid-template-rows: auto auto 1fr;
    column-gap: 16px; row-gap: 12px; align-items: start;
  }
  #panneau-bord .bord-grille:not(.premiere):not(:has(.bord-col-p)) { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
  #panneau-bord .bord-grille:not(.premiere) > .bord-col-g { grid-column: 1; grid-row: 1; }
  #panneau-bord .bord-grille:not(.premiere) > .bord-bas {
    grid-column: 1; grid-row: 2;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto 1fr; column-gap: 12px; row-gap: 12px; align-items: start;
  }
  #panneau-bord .bord-grille:not(.premiere) > .bord-bas > * { grid-column: 2; grid-row: auto; }
  #panneau-bord .bord-grille:not(.premiere) > .bord-bas > .bord-vaisseau { grid-column: 1; grid-row: 1 / -1; }
  #panneau-bord .bord-grille:not(.premiere) > .bord-col-d { display: contents; }
  #panneau-bord .bord-grille:not(.premiere) .bord-col-d > * { grid-column: auto; grid-row: auto; }
  #panneau-bord .bord-grille:not(.premiere) .bord-col-c { display: grid; gap: 12px; grid-column: 2; grid-row: 1 / -1; min-width: 0; align-content: start; }
  #panneau-bord .bord-grille:not(.premiere) .bord-col-p { display: grid; gap: 12px; grid-column: 3; grid-row: 1 / -1; min-width: 0; align-content: start; }
  #panneau-bord .bord-grille:not(.premiere):not(:has(.bord-col-p)) .bord-col-c { grid-column: 2; }
  /* Si la colonne du centre est seule sous un bandeau vide (rien à gauche), elle ne laisse pas de rangée creuse */
  .bord-col-g:empty { display: none; }

  /* Bandeau d'accueil : grand portrait rond doré et phrase de bienvenue */
  .bord-accueil { gap: 1.25rem; margin: 4px 0 14px; }
  .bord-portrait {
    width: 100px; height: 100px; flex: 0 0 100px; border-width: 3px;
    box-shadow: 0 0 0 3px rgba(212, 166, 74, 0.25), 0 0 22px rgba(212, 166, 74, 0.35), 0 6px 16px rgba(0, 0, 0, 0.55);
  }
  .bord-accueil-texte h2 { font-size: 1.9rem; line-height: 1.15; color: var(--or-clair, #f0d797); text-transform: none; letter-spacing: 0.01em; }
  .bord-visite { font-size: 0.95rem; }

  /* Le pack du jour : le paquet à gauche, le texte et le bouton à droite (plus de grand vide) */
  .bord-pack { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: center; }
  .bord-pack > * { grid-column: 1 / -1; min-width: 0; }
  .bord-pack > .paquet-scene { grid-column: 1; grid-row: 2 / span 4; margin: 0; }
  .bord-pack > :is(.pack-attente, .aide, .bord-foire, .raison, .rangee) { grid-column: 2; }
  .bord-pack .paquet-3d { width: 116px; height: 170px; }
  .bord-pack > .rangee { justify-content: flex-start; }
  .bord-pack details { grid-column: 1 / -1; }

  /* Pendant ton absence : l'illustration de fond se voit */
  .bord-absence.carte-fond-illustre { min-height: 0; }
  .bord-col-g .carte-fond-img { opacity: 0.55; }
}
/* La vignette « Dans la Bordure » : plus grande sur grand écran, jamais un carré noir (fond de repli le temps que la galaxie arrive) */
@media (min-width: 1200px) {
  .bord-bordure-corps > .vignette-mini { width: 84px; height: 84px; border-radius: 10px; border-color: rgba(212, 169, 87, 0.5); object-fit: cover; }
}

/* Illustrations du 24/11 : la ville de nuit sous « Pendant ton absence » (voile noir à gauche pour le texte) */
.bord-absence .carte-fond-img { object-position: right center; opacity: .6; }
.bord-absence.carte-fond-illustre::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(90deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, .2) 70%, transparent); }

/* Étapes du chapitre, d'après la maquette : un médaillon rond doré devant chaque étape (vide pour une étape à venir), « fait » en pastille verte
   cochée, « en cours » en pastille dorée. L'état reste écrit en mots : la couleur ne le dit jamais seule. */
.objectif .puces li > span:first-child { display: flex; align-items: center; gap: 10px; min-width: 0; }
.objectif .puces li > span:first-child::before {
  content: ""; flex: none; width: 20px; height: 20px; border-radius: 50%; box-sizing: border-box;
  border: 2px solid var(--or-clair);
  background: radial-gradient(circle at 35% 30%, var(--or-clair), var(--or) 55%, #7d5f2a);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .45), 0 0 6px rgba(212, 169, 87, .4);
}
.objectif .puces li:not(.fait):not(.en-cours) > span:first-child::before { background: transparent; box-shadow: none; border: 1px solid rgba(212, 169, 87, .5); }
.objectif .puces li.fait small, .objectif .puces li.en-cours small {
  padding: 2px 10px; border-radius: 999px; font-weight: 700;
}
.objectif .puces li.fait small { color: #0b1f13; background: var(--bon, #6fcf8a); }
.objectif .puces li.fait small::before { content: "✓ "; }
.objectif .puces li.en-cours small {
  color: #1c1408;
  background: linear-gradient(180deg, #f0d797, #c9a45c);
}
@media (forced-colors: active) {
  .objectif .puces li.en-cours small, .objectif .puces li.fait small { background: none; color: CanvasText; border: 1px solid CanvasText; }
  .objectif .puces li > span:first-child::before { background: CanvasText; }
}
