/* Corporations (relations entre corpos), visite d'une alliée, organigramme */

.rel-badge { display: inline-block; padding: .12rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; border: 1px solid; }
.rel-badge.big { font-size: .95rem; padding: .2rem .8rem; }
.rel-neutral { color: var(--muted); border-color: var(--line); }
.rel-ally { color: var(--ok); border-color: var(--ok); }
.rel-enemy { color: var(--bad); border-color: var(--bad); }
.corp-rules ul { margin: .5rem 0 0; padding-left: 1.1rem; }
.corp-rules li { margin: .35rem 0; }
.corp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.corp-card { display: flex; gap: .9rem; align-items: center; color: var(--text); margin: 0; border-left: 4px solid var(--corp-accent, var(--line)); transition: border-color .15s, transform .15s; }
.corp-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.corp-card.rel-ally { box-shadow: inset 0 0 0 1px rgba(76, 195, 138, .35); }
.corp-card.rel-enemy { box-shadow: inset 0 0 0 1px rgba(229, 83, 79, .35); }
.corp-card h3 { color: var(--text); font-size: 1.05rem; margin: 0 0 .15rem; }
.corp-card p { margin: .15rem 0; }
.corp-logo-box { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; font-size: 1.6rem; color: var(--corp-accent, var(--accent)); }
.corp-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.corp-logo-box.big { width: 88px; height: 88px; font-size: 2.4rem; }
.corp-head { display: flex; gap: 1.2rem; align-items: center; border-left: 5px solid var(--corp-accent, var(--line)); }
.corp-head h1 { margin: 0 0 .2rem; }
.corp-head p { margin: .2rem 0; }
.vote-card { border-color: var(--warn); }
.ballot { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: .6rem 0; }
.ballot ul { list-style: none; margin: 0; padding: 0; }
.ballot li { padding: .15rem 0; }
.ballot li.yes { color: var(--ok); } .ballot li.no { color: var(--bad); } .ballot li.wait { color: var(--muted); }
.vote-actions { display: flex; gap: .6rem; margin: .4rem 0; }
.ally-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.ally-missions { padding-left: 1.1rem; }
.stack-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .8rem; }
.stack-form input[type=text] { flex: 1 1 260px; }
.stack-form p { flex-basis: 100%; margin: 0; }
.danger-zone summary { list-style: none; display: inline-block; }
.danger-zone summary::-webkit-details-marker { display: none; }
.danger-zone form { margin-top: .6rem; padding: .6rem .8rem; border: 1px solid var(--bad); border-radius: 8px; }

/* Visite d'une alliée */
.ally-topbar { border-bottom: 2px solid var(--ok); }
.ally-tag { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ok); border: 1px solid var(--ok); border-radius: 999px; padding: .05rem .45rem; margin-left: .3rem; vertical-align: middle; }
.ally-banner { background: rgba(76, 195, 138, .12); border-bottom: 1px solid rgba(76, 195, 138, .4); padding: .45rem 1rem; font-size: .88rem; text-align: center; }

/* Organigramme */
.org { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2.2rem; padding: .5rem 0 1rem; }
.org-tier { position: relative; display: flex; flex-direction: column; align-items: center; width: 100%; }
.org-insignia { display: block; height: 58px; width: auto; max-width: 120px; object-fit: contain; margin: 0 auto -.15rem;
  position: relative; z-index: 1; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .45)); }
.org-tier + .org-tier::before { content: ""; position: absolute; top: -2.2rem; left: 50%; height: 2.2rem; border-left: 2px solid var(--line); }
.org-grade { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem 1rem; border-radius: 999px; border: 2px solid var(--g, var(--line)); color: var(--g, var(--text)); background: var(--panel); font-size: .95rem; z-index: 1; }
.org-grade .small { color: var(--muted); }
.org-people { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; margin-top: 1rem; padding-top: 1rem; max-width: 100%; }
.org-people::before { content: ""; position: absolute; top: 0; left: 8%; right: 8%; border-top: 2px solid var(--line); }
.org-people::after { content: ""; position: absolute; top: -1rem; left: 50%; height: 1rem; border-left: 2px solid var(--line); }
.org-person { position: relative; display: flex; flex-direction: column; align-items: center; gap: .3rem; width: 120px; padding: .6rem .4rem .5rem; border: 1px solid var(--line); border-top: 3px solid var(--g, var(--line)); border-radius: 10px; background: var(--panel); color: var(--text); text-align: center; }
.org-person:hover { text-decoration: none; border-color: var(--accent); }
.org-person .avatar-wrap { width: 54px; height: 54px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--panel-2); border: 2px solid var(--g, var(--line)); font-weight: 800; }
.org-person .avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }
.org-person .name { font-weight: 700; font-size: .88rem; line-height: 1.2; overflow-wrap: anywhere; }
.org-person .sub { font-size: .72rem; color: var(--muted); }
.org-person .flag { font-size: .66rem; color: var(--ok); }
.org-empty { color: var(--muted); font-size: .85rem; }
.org.anon .org-people { gap: .4rem; align-items: center; }
.anon-dot { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--panel-2); border: 2px solid var(--g, var(--line)); color: var(--muted); font-weight: 800; font-size: .8rem; }
.org.anon .anon-dot::before, .org.anon .org-people .small::before { display: none; }
.org-count { margin-left: .4rem; font-weight: 800; color: var(--text); }
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.view-toggle a { padding: .3rem .8rem; color: var(--text); font-size: .88rem; }
.view-toggle a.on { background: var(--accent); color: #04121c; font-weight: 700; }
.view-toggle a:hover { text-decoration: none; }
@media (max-width: 640px) {
  .org-person { width: 100px; }
  .org-people::before { left: 2%; right: 2%; }
  .corp-head { flex-direction: column; align-items: flex-start; }
}

/* ---- Mercenariat */
.merc-section h2 { margin-top: 0; display: flex; align-items: center; gap: .5rem; }
.merc-todo { border-left: 4px solid #ffb547; }
.merc-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: .4rem 1rem; align-items: center;
  padding: .6rem 0; border-top: 1px solid var(--line); }
.merc-row:first-of-type { border-top: 0; }
.merc-row-end { display: flex; gap: .4rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.merc-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.merc-list li { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.merc-pay { font-weight: 700; color: #fcd34d; white-space: nowrap; }
.merc-state.st-open { color: #a78bfa; border-color: #a78bfa; }
.merc-state.st-offered { color: #ffb547; border-color: #ffb547; }
.merc-state.st-accepted { color: var(--ok); border-color: var(--ok); }
.merc-state.st-declined, .merc-state.st-cancelled { color: var(--bad); border-color: var(--bad); }
.stars { display: inline-flex; align-items: center; gap: 1px; white-space: nowrap; }
.star { color: rgba(255, 255, 255, .18); font-size: 1.05em; line-height: 1; }
.star.on { color: #fbbf24; text-shadow: 0 0 6px rgba(251, 191, 36, .35); }
.stars-n { margin-left: .35rem; font-size: .8rem; color: var(--muted); }
.merc-big-stars .star { font-size: 1.6rem; }
.merc-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .6rem 1.2rem; margin: 1rem 0; }
.merc-facts dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.merc-facts dd { margin: .15rem 0 0; }
.merc-message { margin: 0 0 1rem; padding: .6rem .9rem; border-left: 3px solid #a78bfa; background: var(--panel-2); border-radius: 0 8px 8px 0; }
.merc-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin: .5rem 0 1rem; }
.merc-apply { margin: 1rem 0; padding-top: .8rem; border-top: 1px solid var(--line); }
.merc-apply h2 { margin: 0 0 .5rem; }
.merc-reviews { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.merc-reviews h3 { margin: 0 0 .5rem; font-size: 1rem; }
.merc-review { padding: .6rem 0; border-top: 1px solid var(--line); }
.merc-review:first-child { border-top: 0; }
.merc-review p { margin: .35rem 0 0; }
.merc-review-form textarea { width: 100%; margin: .4rem 0; }
/* note par étoiles cliquables (de droite à gauche pour le survol) */
.star-input { border: 0; padding: 0; margin: 0; display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: .1rem; }
.star-input legend { float: left; width: 100%; font-weight: 600; margin-bottom: .2rem; }
.star-input input { position: absolute; opacity: 0; pointer-events: none; }
.star-input label { font-size: 1.9rem; line-height: 1; cursor: pointer; color: rgba(255, 255, 255, .2); transition: color .1s; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: #fbbf24; }
.star-input input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 4px; }
.merc-directory { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.merc-card { display: flex; flex-direction: column; gap: .35rem; color: inherit; margin: 0; }
.merc-card:hover { text-decoration: none; border-color: #fbbf24; }
.merc-badge { border-color: #fbbf24 !important; color: #fcd34d !important; }
.merc-banner { border-color: #fbbf24; }
@media (max-width: 700px) { .merc-row { grid-template-columns: 1fr; } .merc-row-end { justify-content: flex-start; } }
