/* === Ma ruche ======================================================
   L'espace du joueur, en trois sections à l'en-tête commun (packages/ui/css/section-head.css) : ce wipe (prochain wipe,
   en direct, ta base : trois cartes de même hauteur), ta progression (défis du wipe, presque débloqué), ramène un
   pote. Panneaux sombres, liserés dorés, coins francs. */

.ruche-sections[hidden] {
  display: none;
}
.ruche-section {
  margin-top: 56px;
}
.ruche-row {
  display: grid;
  gap: 18px;
}
.ruche-row--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}
.ruche-row--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.ruche-card {
  padding: 24px 26px;
  border: 1px solid var(--line-gold);
  background: var(--panel-gradient);
  animation: card-rise 0.5s ease both;
}
.ruche-card[hidden] {
  display: none;
}
.ruche-card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: var(--parchment);
  font: 900 var(--fs-card) "Roboto Condensed", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ruche-card__title > i {
  flex: none;
  width: 22px;
  color: var(--gold);
  font-size: 1.05rem;
  text-align: center;
}
.ruche-card__title > span {
  flex: 1;
}
.ruche-card__title b {
  color: var(--gold);
}
.ruche-card__empty {
  margin: 0 0 14px;
  color: var(--text-soft);
  font-size: 0.92rem;
}
/* Ma base sans armoire : une icône et ce qu'il faut faire */
.ruche-base__empty {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 6px 0 0;
  color: var(--text-soft);
}
.ruche-base__empty i {
  flex: none;
  color: #8a7c66;
  font-size: 1.8rem;
}
.ruche-card .text-link {
  margin-top: 14px;
}

/* --- Prochain wipe --- */
.ruche-wipe {
  border-top: 3px solid var(--gold);
}
.ruche-wipe__left {
  display: flex;
  gap: 18px;
  margin: 10px 0 8px;
}
.ruche-wipe__left span {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.ruche-wipe__left small {
  color: #c89146;
  font: 900 0.8rem Roboto, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.ruche-wipe__left strong {
  color: var(--parchment);
  font: 900 2.4rem/1 "Roboto Condensed", sans-serif;
}
.ruche-wipe__date {
  margin: 0;
  color: var(--text);
}
.ruche-wipe__date::first-letter {
  text-transform: uppercase;
}

/* --- En direct --- */
.ruche-live .live-events {
  margin-top: 10px;
}
.ruche-live__restart {
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 0.9rem;
}
.ruche-live__mates {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ruche-live__mates li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
}
.ruche-live__mates i {
  width: 8px;
  height: 8px;
  background: #4a4032;
}
.ruche-live__mates li.is-online {
  color: var(--parchment);
}
.ruche-live__mates li.is-online i {
  background: #58c975;
  box-shadow: 0 0 8px #58c975;
}

/* --- Mes armoires : une carte par TC, sur trois colonnes ; une carte ouverte grandit seule --- */
.ruche-tcs {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ruche-tc {
  border: 1px solid rgba(var(--gold-rgb), 0.22);
  background: var(--panel-gradient);
}
/* La couleur de l'urgence : rouge quand elle s'abîme (fond teinté), miel sous 2 jours */
.ruche-tc.is-bad {
  border-color: rgba(224, 71, 59, 0.6);
  background: linear-gradient(110deg, rgba(120, 30, 22, 0.55), rgba(18, 16, 13, 0.97));
}
.ruche-tc.is-warn {
  border-color: rgba(var(--gold-rgb), 0.45);
}
.ruche-tc summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  padding: 16px 18px 14px;
  cursor: pointer;
  list-style: none;
}
.ruche-tc summary::-webkit-details-marker {
  display: none;
}
.ruche-tc__time {
  color: var(--parchment);
  font: 900 1.7rem/1 "Roboto Condensed", sans-serif;
}
.ruche-tc.is-bad .ruche-tc__time {
  color: var(--red-text);
}
.ruche-tc.is-warn .ruche-tc__time {
  color: var(--gold);
}
/* La case de la carte, en étiquette en haut à droite */
.ruche-tc__grid {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  padding: 2px 7px;
  border: 1px solid rgba(var(--parchment-rgb), 0.25);
  color: var(--parchment);
  font: 900 0.8rem "Roboto Condensed", sans-serif;
}
.ruche-tc__time {
  grid-column: 1;
  grid-row: 1;
}
.ruche-tc__top {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  color: var(--text);
  font-size: 0.88rem;
}
.ruche-tc__top > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ruche-tc__top img,
.ruche-tc__top .is-empty {
  width: 22px;
  height: 22px;
  object-fit: contain;
}
.ruche-tc__top em {
  color: var(--text-soft);
  font-style: normal;
}
.ruche-tc__foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-soft);
  font-size: 0.85rem;
}
.ruche-tc__foot b {
  color: var(--parchment);
}
.ruche-tc__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}
.ruche-tc__more i {
  font-size: 0.8rem;
  transition: transform 0.25s;
}
.ruche-tc details[open] .ruche-tc__more i {
  transform: rotate(180deg);
  color: var(--gold);
}
/* Le détail : quoi ajouter, le contenu en cases d'inventaire, l'entretien, les autorisés, les blocs */
.ruche-tc__detail {
  margin: 0 18px 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(var(--gold-rgb), 0.14);
}
.ruche-tc__detail h3,
.ruche-tc__line small {
  margin: 0 0 6px;
  color: #c89146;
  font: 900 0.8rem Roboto, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ruche-tc__slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, 52px);
  gap: 4px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.ruche-tc__slots li {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  background: rgba(var(--shadow-rgb), 0.35);
  box-shadow: inset 0 0 0 1px rgba(214, 159, 70, 0.14);
}
.ruche-tc__slots img,
.ruche-tc__slots .is-empty {
  width: 38px;
  height: 38px;
  object-fit: contain;
}
.ruche-tc__slots b {
  position: absolute;
  right: 3px;
  bottom: 1px;
  color: var(--parchment);
  font: 700 0.8rem Roboto, sans-serif;
  text-shadow: 0 1px 2px #000;
}
.ruche-tc__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 6px 0 0;
  color: var(--parchment);
  font-size: 0.88rem;
}
.ruche-tc__line small {
  margin: 0;
}
.ruche-tc__upkeep {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.ruche-tc__upkeep span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ruche-tc__upkeep img,
.ruche-tc__upkeep .is-empty {
  width: 20px;
  height: 20px;
  object-fit: contain;
}
/* À ajouter : les mêmes cases, la quantité qui manque en miel */
.ruche-tc__slots.is-add li {
  box-shadow: inset 0 0 0 1px rgba(var(--gold-rgb), 0.45);
}
.ruche-tc__slots.is-add b {
  color: var(--gold);
}

/* --- Mes armoires : trois colonnes (moins si la place manque) --- */
.ruche-base .ruche-tcs {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  align-items: start; /* une armoire ouverte grandit seule, les autres gardent leur hauteur */
}

.ruche-base__summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--parchment);
  font: 700 1.05rem "Roboto Condensed", sans-serif;
  white-space: nowrap;
}
.ruche-base__summary i {
  color: var(--gold);
}
.ruche-base__summary b {
  color: var(--red-text);
}
.ruche-base__summary b::before {
  content: "·";
  margin-right: 10px;
  color: var(--text-soft);
}
.ruche-base__at {
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 0.82rem;
}
.ruche-base > .ruche-base__empty {
  padding: 22px 26px;
  border: 1px solid var(--line-gold);
  background: var(--panel-gradient);
}

/* Les armoires repliées : une ligne pleine largeur, puis la même grille */
.ruche-tcs__more {
  margin-top: 10px;
}
.ruche-tcs__more > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 18px;
  border: 1px solid rgba(var(--gold-rgb), 0.22);
  background: var(--panel-gradient);
  color: var(--gold);
  font: 800 0.8rem/1.2 Roboto, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}
.ruche-tcs__more > summary::-webkit-details-marker {
  display: none;
}
.ruche-tcs__more > summary i {
  font-size: 0.8rem;
  transition: transform 0.25s;
}
.ruche-tcs__more[open] > summary i {
  transform: rotate(180deg);
}
.ruche-tcs__more > .ruche-tcs {
  margin-top: 10px;
}

/* --- Objectif du mois : la jauge, les boosts, le lien, sur une ligne --- */
.ruche-goal {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px 36px;
}
.ruche-goal__gauge {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}
.ruche-goal__gauge > i {
  color: var(--gold);
  font-size: 1.4rem;
}
.ruche-goal__gauge strong {
  color: var(--gold);
  font: 900 1.8rem/1 "Roboto Condensed", sans-serif;
}
.ruche-goal__bar i {
  background: linear-gradient(90deg, #b53a25, var(--gold));
}
.ruche-goal__boosts {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-left: 30px;
  border-left: 1px solid var(--line-gold);
}
.ruche-goal__boosts > i {
  color: var(--gold);
  font-size: 1.3rem;
}
.ruche-goal__boosts b {
  display: block;
  color: var(--parchment);
}
.ruche-goal__boosts span {
  color: var(--text-soft);
  font-size: 0.9rem;
}
.ruche-goal .text-link {
  margin: 0;
}

/* --- Ramène un pote : le lien et le bouton pour le copier --- */
.ruche-invite__share {
  display: flex;
  gap: 10px;
}
.ruche-invite__share input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-gold);
  background: #0e0d0b;
  color: var(--parchment);
  font: 400 0.95rem Roboto, sans-serif;
}
@media (max-width: 640px) {
  .ruche-invite__share {
    flex-direction: column;
  }
}

/* --- Missions (défis du wipe, presque débloqué) --- */
.ruche-missions {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ruche-mission {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(var(--gold-rgb), 0.14);
  background: var(--row-gradient);
}
.ruche-mission__art {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(var(--gold-rgb), 0.18);
  background: rgba(var(--shadow-rgb), 0.3);
}
/* Le dessin de Trophées (packages/ui/css/trophy-art.css), un peu en retrait du cadre */
.ruche-mission__art .art {
  width: 82%;
  height: 82%;
}
.ruche-mission strong {
  display: block;
  color: var(--parchment);
}
.ruche-mission small {
  color: var(--text-soft);
  font-size: 0.85rem;
}
.ruche-mission__bar {
  margin: 6px 0 4px;
}
.ruche-mission__tier {
  color: var(--gold);
  font: 900 1.2rem "Roboto Condensed", sans-serif;
}
.ruche-mission__tier small {
  color: var(--text-soft);
  font-size: 0.8rem;
}
.ruche-mission.is-done {
  border-color: rgba(var(--gold-rgb), 0.45);
}

@media (max-width: 1100px) {
  .ruche-row--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .ruche-row--3,
  .ruche-row--2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .ruche-card {
    padding: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ruche-card {
    animation: none;
  }
}

/* Les défis au-delà des trois premiers, repliés */
.ruche-missions__more > summary {
  margin-top: 12px;
  cursor: pointer;
  list-style: none;
}
.ruche-missions__more > summary::-webkit-details-marker {
  display: none;
}
.ruche-missions__more[open] > summary {
  display: none;
}
.ruche-missions__more > .ruche-missions {
  margin-top: 8px;
}
@media (max-width: 1100px) {
  .ruche-goal {
    grid-template-columns: minmax(0, 1fr);
  }
  .ruche-goal__boosts {
    padding-left: 0;
    border-left: 0;
  }
}

/* Ton dernier wipe : une ligne sous les cartes de ce wipe, vers son bilan */
.ruche-last {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
  padding: 14px 20px;
  border: 1px solid var(--line-gold);
  background: var(--panel-gradient);
  color: var(--text);
}
.ruche-last[hidden] {
  display: none;
}
.ruche-last:hover {
  border-color: var(--gold);
}
.ruche-last > i {
  color: var(--gold);
  font-size: 1.4rem;
}
.ruche-last__title {
  color: var(--parchment);
  font: 900 1rem "Roboto Condensed", sans-serif;
  text-transform: uppercase;
}
.ruche-last__title small {
  display: block;
  color: var(--text-soft);
  font: 400 0.82rem Roboto, sans-serif;
  text-transform: none;
}
.ruche-last__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.ruche-last__facts b {
  color: var(--gold);
}
.ruche-last__facts i {
  color: var(--text-soft);
  font-style: normal;
}
.ruche-last .text-link {
  margin: 0;
}
@media (max-width: 900px) {
  .ruche-last {
    grid-template-columns: auto minmax(0, 1fr);
  }
}

/* Les animations : les armoires et les défis montent en cascade à leur arrivée, les barres se remplissent quand leur
   section entre dans l'écran (la section elle-même : .reveal, theme/css/ambient.css) */
.is-entering :is(.ruche-tc, .ruche-mission) {
  animation: card-rise 0.45s ease both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.ruche-section.is-visible :is(.ruche-goal__bar, .ruche-mission__bar) i {
  animation: fill-bar 0.9s cubic-bezier(0.3, 0.7, 0.2, 1) 0.15s both;
}
@media (prefers-reduced-motion: reduce) {
  .is-entering :is(.ruche-tc, .ruche-mission),
  .ruche-section.is-visible :is(.ruche-goal__bar, .ruche-mission__bar) i {
    animation: none;
  }
}

/* Mobile : « Ton dernier wipe » sur deux lignes (l'icône et le titre, puis les chiffres et le lien) ; en une seule, elle
   dépassait de l'écran (contrôle final, 10 oct.) */
@media (max-width: 700px) {
  .ruche-last {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 14px;
  }
  .ruche-last__facts,
  .ruche-last .text-link {
    grid-column: 1 / -1;
  }
}
