/* [40-hud-bottom] HUD inférieur : chat, menu, panneau du conseiller, sélecteurs de quartiers, rangée du bas */
/* ==========================================================================
   4. HUD INFÉRIEUR
   - Chat à gauche : onglets TOUS / FAMILLE / CREW, texte jaune, ascenseur bronze
   - Menu : tuiles d'icônes or au-dessus d'une bande noire de libellés
   - Panneau du conseiller : cadre diagonal doré, 3 vues inclinées, consigliere
   - Rangée du bas : fin du tournoi, défilant du classement, SALLE DU CONSEIL
   ========================================================================== */
#bottom-bar-hud {
  --bb-gold: #93764f;
  --bb-gold-hi: #ceb28e;
  --bb-deco: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M0 24 12 12 24 24M0 12 12 0 24 12M12 0v24' fill='none' stroke='%23c9a24a' stroke-opacity='.09' stroke-width='1'/%3E%3C/svg%3E");
  position: absolute;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  font-family: 'Josefin Sans', 'Gill Sans', 'Trebuchet MS', sans-serif;
}
#bottom-bar-hud > * { pointer-events: auto; }

/* ---------- Chat ---------- */
.mini-chat-box {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 286px;
  height: 195px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  background: var(--ink-black);
  border: 2px solid var(--bb-gold);
  border-left: none;
  border-bottom: none;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.7);
  transition: height 0.2s ease;
}
.mini-chat-box.collapsed { height: 50px; }
.mini-chat-box.collapsed .chat-stream-list { display: none; }

.chat-channel-tabs {
  display: flex;
  flex-shrink: 0;
  height: 23px;
  background: linear-gradient(180deg, #2e2e2e 0%, #121212 100%);
  border-bottom: 2px solid var(--bb-gold);
}
.chat-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  letter-spacing: 0.3px;
  cursor: pointer;
  border-right: 2px solid var(--bb-gold);
  text-shadow: 0 1px 1px #000;
  transition: background 0.15s;
}
.chat-tab-btn:last-child { border-right: none; }
.chat-tab-btn.tab-all { color: #fff; }
.chat-tab-btn.tab-family { color: #bb915a; }
.chat-tab-btn.tab-crew { color: #4fb28e; }
.chat-tab-btn:hover { background: rgba(255, 255, 255, 0.06); }
.chat-tab-btn.active { background: linear-gradient(180deg, var(--ink-black) 0%, #1c1c1c 100%); }

.chat-stream-list {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  padding: 3px 4px 3px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12.5px;
  line-height: 1.3;
  color: #c6985b;
  user-select: text;
  /* ascenseur bronze à flèches rouges (Chromium/Safari) */
  scrollbar-color: #98774c #322718;
}
.chat-stream-list::-webkit-scrollbar { width: 12px; }
.chat-stream-list::-webkit-scrollbar-track {
  background: linear-gradient(90deg, #4d3a21, #a8875c 50%, #4d3a21);
  border-left: 1px solid #241a0e;
}
.chat-stream-list::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #765934, #d0ad80 50%, #765934);
  border: 1px solid #302311;
  border-radius: 2px;
}
.chat-stream-list::-webkit-scrollbar-button:single-button {
  display: block;
  height: 12px;
  background-color: #c6ad8c;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 8px;
}
.chat-stream-list::-webkit-scrollbar-button:single-button:vertical:decrement {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 7 5 3.5 8.5 7' fill='none' stroke='%23c01010' stroke-width='2'/%3E%3C/svg%3E");
}
.chat-stream-list::-webkit-scrollbar-button:single-button:vertical:increment {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 3 5 6.5 8.5 3' fill='none' stroke='%23c01010' stroke-width='2'/%3E%3C/svg%3E");
}

.chat-msg-row { color: #c6985b; }
.chat-msg-system { color: #c6985b; }
.chat-msg-sender { color: #cf9e5d; font-weight: 700; }
.chat-msg-text { color: #c6985b; }

.chat-submit-row {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  height: 25px;
  border-top: 2px solid #b8b8b8;
  box-shadow: inset 0 1px 0 #444;
  background: var(--ink-black);
}
.chat-text-input {
  flex: 1;
  min-width: 0;
  padding: 0 6px;
  background: transparent;
  border: none;
  outline: none;
  color: #c6985b;
  font-family: inherit;
  font-size: 12px;
  user-select: text;
}
.chat-collapse-btn {
  width: 18px;
  margin: 3px 2px 3px 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #dec9ae, #a4865f);
  border: 1px solid #4d3a21;
  border-radius: 2px;
  color: #389878;
  cursor: pointer;
}
.chat-collapse-btn svg { width: 10px; height: 10px; }
.mini-chat-box:not(.collapsed) .chat-collapse-btn svg { transform: rotate(180deg); }

/* ---------- Menu : 6 tuiles (63 px d'intervalle) + bande de libellés ---------- */
.main-menu-panel {
  position: absolute;
  left: 290px;
  bottom: 27px;
  width: 456px;
  height: 54px;
}
/* bande noire : liseré or en haut et à gauche, bout droit coupé par la diagonale */
.main-menu-panel::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 20px;
  background: linear-gradient(180deg, var(--bb-gold-hi), var(--bb-gold));
  clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}
.main-menu-panel::after {
  content: '';
  position: absolute;
  left: 2px;
  right: 0;
  bottom: 0;
  height: 18px;
  background: linear-gradient(180deg, #0c0c0c 0%, #000 100%);
  clip-path: polygon(0 0, calc(100% - 2px) 0, calc(100% - 13px) 100%, 0 100%);
}
.main-menu-row {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100%;
  padding-left: 6px;
}
.menu-btn {
  position: relative;
  width: 62px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}
.menu-icon {
  width: 35px;
  height: 33px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #1a1c1d 0%, #08090a 100%);
  border: 1px solid var(--gold-brass);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px #000, inset 0 1px 0 rgba(235, 207, 170, 0.12), 0 1px 3px rgba(0, 0, 0, 0.9);
  transition: background 0.12s, box-shadow 0.12s;
}
.menu-icon svg { width: 29px; height: 29px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.8)); }
.menu-btn:hover .menu-icon {
  background: linear-gradient(180deg, #ba4234 0%, #7a241a 100%);
  box-shadow: inset 0 0 0 1px #0f2d23, 0 0 8px rgba(206, 178, 142, 0.5);
}
.menu-label {
  width: 100%;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  color: #dacab4;
  white-space: nowrap;
  text-shadow: 0 1px 1px #000;
}
.menu-btn:hover .menu-label {
  color: #fff;
  background: linear-gradient(180deg, rgba(47, 127, 100, 0.55), rgba(17, 47, 37, 0.55));
}

/* boutons son, à droite de la bande */
.menu-sound-btns {
  position: absolute;
  z-index: 1;
  right: 18px;
  bottom: 0;
  height: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.menu-sound-btn {
  width: 16px;
  height: 16px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}
.menu-sound-btn svg { width: 16px; height: 16px; display: block; filter: drop-shadow(0 1px 1px #000); }
.menu-sound-btn:hover { filter: brightness(1.25); }
.menu-sound-btn.muted { filter: grayscale(1) brightness(0.6); }

/* pastille rouge en demi-lune sous l'icône (comme « File 2 ») */
.btn-badge-count {
  position: absolute;
  top: 23px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 20px;
  height: 11px;
  padding: 0 3px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #e45545, #9b2d21 70%);
  border-radius: 10px 10px 2px 2px;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 1px #000;
}
/* étiquette SOLDES (bannière rouge en pointe) */
.menu-sale-tag {
  position: absolute;
  top: 21px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 7px 1px 4px;
  background: linear-gradient(180deg, #ce4535, #88271c);
  border: 1px solid #fff;
  clip-path: polygon(0 0, 100% 0, calc(100% - 5px) 50%, 100% 100%, 0 100%);
  color: #fff;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.1;
}

/* alerte d'incursion : bandeau posé au-dessus des tuiles */
.main-menu-panel .frontgate-alert-banner {
  position: absolute;
  left: 0;
  right: 12px;
  bottom: calc(100% + 4px);
  width: auto;
}

/* ---------- Panneau du conseiller (vues + consigliere) ---------- */
.view-dock {
  position: absolute;
  left: 734px;
  right: 0;
  bottom: 21px;
  height: 94px;
  pointer-events: none;
}
/* cadre : diagonale et haut à double filet or, fond sombre */
.view-dock-frame {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--bb-gold-hi), var(--bb-gold));
  clip-path: polygon(64px 0, 100% 0, 100% 100%, 0 100%);
}
.view-dock-frame::before {
  content: '';
  position: absolute;
  inset: 2px 0 0 2px;
  background: var(--bb-deco) 0 0 / 24px 24px, linear-gradient(180deg, #15171a 0%, #050607 100%);
  clip-path: polygon(63px 0, 100% 0, 100% 100%, 0 100%);
}
.view-dock-frame::after {
  content: '';
  position: absolute;
  inset: 6px 0 0 9px;
  border-top: 1px solid rgba(147, 118, 79, 0.7);
  clip-path: polygon(62px 0, 100% 0, 100% 100%, 0 100%);
  background: linear-gradient(56deg, transparent calc(50% - 1px), rgba(147, 118, 79, 0.55) 50%, transparent calc(50% + 1px)) 0 0 / 100px 100% no-repeat;
}

.view-nav-center-wrapper {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}
.view-nav-center { position: absolute; inset: 0; }

/* deux vignettes en parallélogramme (Domaines, Ville), empilées le long de la diagonale */
.view-card-btn {
  position: absolute;
  width: 84px;
  height: 25px;
  padding: 0;
  box-sizing: border-box;
  pointer-events: auto;
  cursor: pointer;
  background: linear-gradient(180deg, var(--bb-gold-hi), var(--bb-gold));
  clip-path: polygon(13px 0, 100% 0, calc(100% - 13px) 100%, 0 100%);
  transition: filter 0.15s;
}
#btn-view-estate { left: 65px; top: 20px; }
#btn-view-city { left: 47px; top: 48px; }
.view-card-thumb {
  position: absolute;
  inset: 2px;
  background-size: cover;
  background-position: center;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  filter: saturate(0.8) brightness(0.75);
  transition: filter 0.15s;
}
.view-card-btn:hover .view-card-thumb { filter: none; }
.view-card-btn.active { background: linear-gradient(180deg, #f3e2cc, var(--gold-sand)); }
.view-card-btn.active .view-card-thumb { filter: none; }
.thumb-estate { background-color: #1d1b18; }
.thumb-neighborhood { background-image: url('../assets/images/backgrounds/neighborhoods/neighborhood_bg.webp'); }
.thumb-city { background-image: url('../assets/images/backgrounds/city_map_bg.webp'); }

/* Répertoire des domaines et des quartiers (survol des vignettes Domaine et Quartier) : panneau art déco en deux colonnes */
.dir-panel {
  position: absolute;
  right: calc(100% + 8px);
  bottom: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 210px 190px;
  gap: 0;
  padding: 8px;
  background: var(--deco-fans, none) 0 0 / 40px 20px, var(--deco-charcoal, #15171a);
  border: 1px solid var(--deco-brass, #b98b4e);
  outline: 2px double var(--deco-brass, #b98b4e);
  outline-offset: -6px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.view-dock.open-dir .dir-panel { pointer-events: auto; opacity: 1; transform: none; }
.dir-col { display: flex; flex-direction: column; min-width: 0; padding: 4px 6px; }
.dir-col + .dir-col { border-left: 1px solid rgba(185, 139, 78, 0.4); }
.dir-head { padding: 2px 4px 6px; font: 12px 'Limelight', serif; letter-spacing: 1px; color: var(--deco-brass-hi, #e2c48f); border-bottom: 1px solid rgba(185, 139, 78, 0.4); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dir-list { display: flex; flex-direction: column; gap: 2px; max-height: 330px; overflow-y: auto; }
.dir-domain, .dir-quartier, .dir-estate {
  position: relative; display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 26px 4px 8px; text-align: left; cursor: pointer;
  font-family: 'Josefin Sans', sans-serif; color: var(--deco-ivory, #e9dfc8); background: transparent; border: 1px solid transparent;
}
.dir-domain { flex-direction: column; align-items: flex-start; gap: 0; }
.dir-name { font-size: 12.5px; line-height: 1.25; }
.dir-sub { font-size: 10.5px; color: #9c927e; }
.dir-domain:hover, .dir-domain.is-hover, .dir-quartier:hover { background: rgba(31, 90, 72, 0.45); border-color: rgba(185, 139, 78, 0.5); }
.dir-domain.is-active, .dir-quartier.is-active { box-shadow: inset 3px 0 0 var(--deco-brass, #b98b4e); }
.dir-domain.is-active .dir-name, .dir-quartier.is-active .dir-name { color: var(--deco-brass-hi, #e2c48f); }
.dir-domain.is-locked .dir-name, .dir-quartier.is-locked .dir-name { color: #8a8170; }
.dir-quartier.is-locked { cursor: default; }
.dir-lock { position: absolute; right: 6px; top: 50%; width: 13px; height: 13px; margin-top: -7px; opacity: 0.85; }
.dir-thumb { flex: 0 0 52px; height: 32px; background: #222 center / cover no-repeat; border: 1px solid rgba(185, 139, 78, 0.6); }
.dir-quartier.is-locked .dir-thumb { filter: grayscale(1) brightness(0.6); }
.dir-estate { justify-content: center; margin-top: 8px; padding: 6px 8px; font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase;
  background: linear-gradient(180deg, #2f7d63, #1f5a48 55%, #143a2f); border: 1px solid var(--deco-brass, #b98b4e); }
.dir-estate:hover { filter: brightness(1.15); }
.dir-empty { padding: 6px 8px; font-size: 11.5px; color: #9c927e; }

/* Consigliere détouré, debout dans le panneau, tête qui dépasse */
#bottom-bar-hud > .advisor-dock {
  position: absolute;
  right: 0;
  bottom: 21px;
  width: 300px;
  height: 140px;
  pointer-events: none;
}
.advisor-portrait-frame {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 108px;
  height: 136px;
  overflow: hidden;
  pointer-events: auto;
  cursor: pointer;
}
.advisor-portrait-frame img {
  display: block;
  width: 100%;
  height: 100%;
}
.consigliere-speech-bubble {
  position: absolute;
  right: 100px;
  bottom: 112px;
  width: 170px;
  padding: 6px 9px;
  background: #f6eee4;
  border: 1px solid #785f3e;
  border-radius: 4px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
  color: #23190d;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.3;
  pointer-events: auto;
}
.bubble-arrow {
  position: absolute;
  right: -7px;
  bottom: 10px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 7px solid #f6eee4;
}
.advisor-toggle-tab {
  position: absolute;
  right: 2px;
  bottom: 118px;
  width: 14px;
  height: 20px;
  padding: 0;
  background: linear-gradient(180deg, #b04135, #5e1a13);
  border: 1px solid var(--bb-gold);
  border-radius: 3px;
  color: #fff;
  font-size: 9px;
  cursor: pointer;
  pointer-events: auto;
}
.advisor-dock.collapsed .consigliere-speech-bubble { display: none; }
/* la bulle s'efface quand l'éventail des quartiers est ouvert */
#bottom-bar-hud:has(.view-dock.open-dir) .consigliere-speech-bubble { opacity: 0; pointer-events: none; }

/* ---------- Rangée du bas ---------- */
.bottom-ticker-row {
  position: absolute;
  left: 288px;
  right: 0;
  bottom: 0;
  height: 21px;
  display: flex;
  align-items: stretch;
  background: var(--ink-black);
  border-top: 1px solid #352e25;
}
.tourney-countdown {
  width: 182px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border: 1px solid var(--bb-gold);
  border-left: none;
  font-size: 11px;
  color: #f2f2f2;
  white-space: nowrap;
  cursor: pointer;
}
.tourney-countdown strong { font-weight: 400; color: #d1a46a; font-variant-numeric: tabular-nums; }
.tourney-ticker-btn {
  width: 29px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #e1cbaf, #a2835a);
  border: 1px solid #4d3a21;
  cursor: pointer;
}
.tourney-ticker-btn svg { width: 15px; height: 15px; }
.tourney-ticker {
  position: relative;
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, #dfdbd5 0%, #c8c2b2 100%);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}
.tourney-ticker-text {
  position: absolute;
  left: 0;
  white-space: nowrap;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  font-weight: 700;
  color: #327c63;
  will-change: transform;
}
.btn-council-room {
  width: 194px;
  margin-left: 4px;
  padding: 0;
  background: linear-gradient(180deg, #d44838 0%, #aa3023 45%, #791f15 100%);
  border: 1px solid #f3b3ac;
  border-bottom: none;
  box-shadow: inset 0 0 0 1px #195340, inset 0 2px 0 rgba(244, 187, 181, 0.5);
  color: #fff;
  font-family: 'Limelight', serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-shadow: 0 1px 2px #0d2d22;
  cursor: pointer;
}
.btn-council-room:hover { filter: brightness(1.12); }

/* plus de mission : la bulle du Consigliere disparaît (comme l'original) */
.consigliere-speech-bubble.no-mission { display: none; }

/* Bouton Crew : un bouton apparaît au-dessus au survol (diplomatie des Familles) */
.menu-btn-wrap { position: relative; flex: none; display: flex; height: 100%; }
.menu-flyout { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); padding-bottom: 4px; display: none; z-index: 5; }
.menu-btn-wrap:hover .menu-flyout { display: block; }
/* Tuile rouge à bord doré, comme les boutons de l'original, au-dessus du bouton Crew */
.menu-flyout-btn { display: block; width: 35px; height: 33px; padding: 2px; box-sizing: border-box; cursor: pointer; background: linear-gradient(180deg, #c24d40 0%, #8b2c21 100%); border: 1px solid #be9d72; border-radius: 3px; box-shadow: inset 0 0 0 1px #501710, 0 2px 6px #000; }
.menu-flyout-btn svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.7)); }
.menu-flyout-btn:hover { filter: brightness(1.18); }
/* Plusieurs tuiles empilées au-dessus d'un bouton (Recruter : Prison et Défense) ; tuile sombre à liseré doré comme les boutons du menu */
.menu-flyout-stack { flex-direction: column; gap: 4px; }
.menu-btn-wrap:hover .menu-flyout-stack { display: flex; }
.menu-flyout-btn.is-dark { background: linear-gradient(180deg, #1a1c1d 0%, #08090a 100%); border-color: var(--gold-brass); box-shadow: inset 0 0 0 1px #000, 0 2px 6px #000; }
.menu-flyout-btn.is-dark:hover { background: linear-gradient(180deg, #ba4234 0%, #7a241a 100%); filter: none; }
/* Nombre de nouveaux objets (pas encore vus) sous la mallette de l'inventaire */
.menu-flyout-btn { position: relative; }
.flyout-badge { position: absolute; left: 50%; bottom: -3px; transform: translateX(-50%); min-width: 17px; height: 11px; padding: 0 3px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 0%, #e45545, #9b2d21 70%); border-radius: 10px 10px 2px 2px; color: #fff; font-size: 9px; font-weight: 700; line-height: 1; text-shadow: 0 1px 1px #000; }


/* Mobile : le cadre en diagonale épouse les deux vignettes (Domaines, Ville) au lieu de s'étendre jusqu'au bord de l'écran */
html.mobile-layout .view-dock { left: auto; right: 0; width: 166px; height: 80px; }
html.mobile-layout #btn-view-estate { top: 14px; }
html.mobile-layout #btn-view-city { top: 42px; }
