/* Terra Nova (ui/terranova.js) : bandeau du lieu, fenêtre « Terra Nova » (carte et lieux).
   --j : vert de la planète (data/worlds.js → WORLDS.terranova.color). */

/* Bandeau : en haut à gauche, sous la carte du joueur (l'objectif d'un métier passe dessous) : le nom du lieu où l'on
   est ; un clic ouvre la carte */
.tn-band {
  position: absolute; top: 84px; left: 16px; z-index: 1;
  display: flex; align-items: center; gap: 8px; max-width: min(300px, calc(100vw - 32px));
  padding: 8px 12px; border-radius: 12px; cursor: pointer; pointer-events: auto;
  background: var(--panel); border: 1px solid color-mix(in srgb, #9fdc6a 35%, var(--line)); backdrop-filter: blur(6px);
  box-shadow: 0 0 16px rgba(159, 220, 106, 0.12);
}
.tn-band:hover, .tn-band:focus-visible { border-color: #9fdc6a; outline: none; }
#hud:has(.tn-band:not(.hidden)) .hud-job { top: 166px; }
#hud:has(.tn-band:not(.hidden)) .hud-fx { top: 166px; }
/* (objectif d'un métier affiché en même temps : les effets passent dessous, comme ailleurs : css/jobs.css, 58 px plus bas) */
#hud:has(.tn-band:not(.hidden)):has(.hud-job:not(.hidden)) .hud-fx { top: 224px; }
.tn-band span { font-size: 15px; line-height: 1; }
.tn-band b { font-family: 'Orbitron'; font-size: 13px; letter-spacing: 0.04em; color: #c8f0a4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Téléphone : la carte du joueur est plus petite et à 8 px des bords (css/touch.css) ; le bandeau la suit (vu le 14/11 :
   il restait à 16 px du bord, 26 px sous la carte) */
@media (max-width: 520px), (max-height: 430px) {
  .tn-band { top: 64px; left: 8px; padding: 6px 10px; }
  /* les messages (à 64 px sur un téléphone : css/touch.css) passent sous le bandeau, et sous la gibecière s'il y en a une */
  #hud:has(.tn-band:not(.hidden)) #toasts { top: 102px; }
  #hud:has(.tn-gibier:not(.hidden)) #toasts { top: 140px; }
}
/* La barre « Fermer » est dans .tn, pas directement dans #panel-body : sans cette règle (celle de css/menus.css ne vaut
   que pour un enfant direct), la liste se voyait sur 22 px sous la barre */
#panel-body:has(> .tn > .panel-actions:last-child) { padding-bottom: 0; }

/* Fenêtre : les deux plans côte à côte (l'un sous l'autre sur un écran étroit), puis les listes */
.tn-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; align-items: start; }
.tn-plans figure { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.tn-plans figcaption { font-size: 13px; color: var(--muted); text-align: center; }
.tn-carte { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); background: #2a4f63; }
.tn-vendeurs, .tn-lieux { margin: 0; padding: 0; display: grid; gap: 6px; }
.tn-vendeurs { list-style: none; counter-reset: tnv; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tn-vendeurs li {
  counter-increment: tnv; display: grid; grid-template-columns: 26px 1fr; column-gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.04);
}
.tn-vendeurs li::before {
  content: counter(tnv); grid-row: 1 / span 3; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: #f2f4ff; color: #05070f; font-weight: 700; font-size: 13px;
}
.tn-vendeurs li span, .tn-vendeurs li small, .tn-lieux li small { color: var(--muted); font-size: 13px; }
.tn-lieux { list-style: none; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tn-lieux li { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); }
.tn-lieux li b, .tn-vendeurs li b { color: #c8f0a4; }

/* La chasse (ui/tn-chasse.js) : l'arc en main. Pastille en bas, viseur au centre (il se resserre quand on bande),
   point de chute du trait. Rien ne prend les clics. */
.tn-arc {
  position: absolute; left: 50%; bottom: 118px; transform: translateX(-50%); z-index: 2; pointer-events: none;
  display: flex; align-items: center; gap: 12px; padding: 7px 14px; border-radius: 12px; white-space: nowrap;
  background: rgba(8, 12, 20, 0.6); border: 1px solid rgba(159, 220, 106, 0.35); backdrop-filter: blur(4px);
  font-size: 15px; color: var(--text);
}
.tn-arc b { color: #c8f0a4; }
.tn-arc .vide { color: #ff8a7a; }
.tn-arc small { font-size: 13px; color: var(--muted); }
.tn-arc kbd { font-size: 12px; }
.tn-viseur { position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: 2; pointer-events: none; }
.tn-viseur i {
  position: absolute; left: -15px; top: -15px; width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.55); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  transform: scale(calc(1 - 0.72 * var(--k, 0))); opacity: 0.45;
}
.tn-viseur.tendu i { opacity: 0.95; border-color: #e8f6d8; }
.tn-viseur::after {
  content: ''; position: absolute; left: -1.5px; top: -1.5px; width: 3px; height: 3px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.9); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
}
.tn-chute {
  position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 2; pointer-events: none;
}
.tn-chute::after {
  content: ''; position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%;
  border: 1.5px solid #c8f0a4; background: rgba(159, 220, 106, 0.25); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}
@media (max-width: 720px) { .tn-arc small { display: none; } }

/* Le butin (ui/tn-chasse.js) : la gibecière (pastille sous le bandeau), le dépeçage en cours, la fenêtre du marchand */
.tn-gibier {
  position: absolute; left: 16px; top: 128px; z-index: 2; pointer-events: none;
  padding: 5px 12px; border-radius: 10px; white-space: nowrap; font-size: 14px; color: var(--text);
  background: rgba(8, 12, 20, 0.6); border: 1px solid rgba(214, 170, 110, 0.4); backdrop-filter: blur(4px);
}
.tn-gibier b { color: #e8c896; }
@media (max-width: 520px), (max-height: 430px) { .tn-gibier { top: 102px; left: 8px; } }
.tn-depece {
  position: absolute; left: 50%; bottom: 168px; transform: translateX(-50%); z-index: 2; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 12px;
  background: rgba(8, 12, 20, 0.66); border: 1px solid rgba(214, 170, 110, 0.4); backdrop-filter: blur(4px);
  font-size: 15px; color: var(--text);
}
.tn-depece i { display: block; width: 180px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.tn-depece i b { display: block; height: 100%; width: calc(100% * var(--k, 0)); background: #e8c896; }
.tn-vente .tn-butin-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.tn-vente .tn-butin-list li {
  display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center; padding: 8px 12px;
  border-radius: 10px; background: rgba(255, 255, 255, 0.05);
}
.tn-vente .tn-butin-list small { color: var(--muted); }
.tn-vente .tn-butin-total { margin: 10px 0; }

/* La chute (ui/tn-chasse.js) : bandeau « blessé » (discret) ou « à terre » (au centre), repère du butin perdu */
.tn-etat {
  position: absolute; left: 50%; top: 168px; transform: translateX(-50%); z-index: 2; pointer-events: none;
  display: flex; align-items: center; gap: 10px; padding: 6px 14px; border-radius: 10px; white-space: nowrap;
  background: rgba(30, 8, 8, 0.62); border: 1px solid rgba(255, 120, 100, 0.45); backdrop-filter: blur(4px);
  font-size: 14px; color: var(--text);
}
.tn-etat b { color: #ff9a8a; }
.tn-etat small { color: var(--muted); }
.tn-etat.bas {
  top: 38%; flex-direction: column; gap: 6px; padding: 16px 26px; border-radius: 14px; font-size: 16px; text-align: center;
  background: rgba(20, 6, 6, 0.74);
}
.tn-etat.bas b { font-size: 26px; letter-spacing: 0.06em; text-transform: uppercase; }
.tn-perdu {
  position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; margin: -14px 0 0 -44px; padding: 3px 9px;
  border-radius: 9px; white-space: nowrap; font-size: 13px; color: #f3dcb4;
  background: rgba(8, 12, 20, 0.62); border: 1px solid rgba(214, 170, 110, 0.5);
}
