/* TW2-window inspired theme: wood chrome, gold trim, paper body,
   dark section bands — original CSS approximations of the game's UI. */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: Verdana, Arial, sans-serif;
    background: #241a10;
    color: #3b2b1a;
    min-height: 100vh;
    font-size: 13px;
}

/* --- top bar: textured band, logo, flat gold nav (mockup style) --- */
.top-bar {
    background: #1a120a url('img/band.jpg') center / cover no-repeat;
    padding: 18px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    box-shadow: 0 4px 14px rgba(0,0,0,.7);
}

/* header en trois zones : logo | onglets | contrôles — les deux zones
   latérales se partagent l'espace à parts égales, les onglets restent donc
   centrés tant que la place le permet, et sont repoussés (sans jamais se
   superposer) quand un côté devient trop large */
.top-left { display: flex; gap: 18px; align-items: center; flex: 1; }

.site-logo { height: 80px; width: auto; margin: -8px 0; filter: drop-shadow(0 3px 5px rgba(0,0,0,.6)); }

.title-block { display: flex; flex-direction: column; }

.top-bar h1 { line-height: 0; }

.wordmark {
    height: 56px;
    width: auto;
    filter: drop-shadow(0 3px 5px rgba(0,0,0,.6));
}

.t-gold {
    background: linear-gradient(#f4d789, #c9973f 60%, #a9772d);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.t-white { color: #f2efe8; }

.tribe-caption {
    color: #c9a45c;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 1px 2px #000;
}

.top-nav { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; justify-content: flex-end; flex: 1; }

.tab-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tab-links .tab-link { font-size: 19px; letter-spacing: .5px; }

.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #f0eade;
    font-size: 15px;
    font-weight: bold;
    padding: 9px 18px;
    cursor: pointer;
    text-decoration: none;
    text-shadow: 0 2px 3px rgba(0,0,0,.7);
    white-space: nowrap;
}

.nav-item:hover { color: #fff; }
.nav-item:hover .nav-ico { fill: #ffd77a; }

.tab-link { opacity: .55; }
.tab-link.active { opacity: 1; color: #ffd77a; }

.ach-delta { color: #07770b; font-weight: bold; font-size: 11px; margin-left: 4px; }
.pts-neg { color: #b30000; font-weight: bold; font-size: 11px; margin-left: 4px; }
td.ach-winner { background: #d9edc4 !important; }
td.ach-check { color: #07770b; font-weight: bold; font-size: 15px; }

.sub-tabs { margin-bottom: 12px; display: flex; gap: 6px; }

.sub-tabs button {
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    padding: 6px 16px;
    border: 1px solid #b18e55;
    border-radius: 4px;
    cursor: pointer;
    color: #5d4223;
    background: #ecd69f;
}

.sub-tabs button.active {
    background: linear-gradient(#c9a45c, #a9823d);
    color: #2b2117;
    border-color: #5d4223;
}

.ach-day-block { margin-bottom: 24px; }

.ach-day-title {
    background: linear-gradient(#4a5158, #343a40);
    color: #f0f0f0;
    font-weight: bold;
    text-align: center;
    padding: 6px 10px;
    border: 1px solid #2b2f33;
    border-bottom: none;
    text-shadow: 1px 1px 1px #000;
}

.nav-ico { width: 20px; height: 20px; fill: #c9973f; flex: none; }

.metric-switch { display: flex; align-items: center; border: none; border-radius: 0; overflow: visible; }

.metric-switch .nav-item { opacity: .55; }
.metric-switch .nav-item.active { opacity: 1; }
.metric-switch .nav-item.active .nav-ico { fill: #ffd77a; }

.nav-sep { width: 1px; height: 34px; background: rgba(201, 164, 92, .35); margin: 0 6px; flex: none; }

.menu-round {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #c9973f;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
}

.menu-round .nav-ico { width: 22px; height: 22px; }
.menu-round:hover { border-color: #ffd77a; }
.menu-round:hover .nav-ico { fill: #ffd77a; }

.dropdown-list.menu-list { right: 0; left: auto; min-width: 220px; padding: 5px; }

/* la liste du filtre tribus (onglet Bash) vit dans un panneau à overflow
   caché : position fixe (ancrée en JS sous le bouton) pour ne jamais être
   rognée, même quand le tableau est minuscule */
#bash-tribe-list, #points-tribe-list { position: fixed; left: auto; top: auto; z-index: 300; }

.menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    background: none;
    border: none;
    border-radius: 3px;
    color: #3b2b1a;
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.menu-item:hover { background: #ecd69f; }

.dl-ico {
    width: auto;
    height: 24px;
    vertical-align: middle;
    margin: -4px 6px -2px 0;
}

.wood-btn {
    font-family: inherit;
    font-size: 13px;
    color: #f6e3b4;
    background: linear-gradient(#7a5a33, #5d4223);
    border: 1px solid #c9a45c;
    border-radius: 4px;
    padding: 6px 14px;
    cursor: pointer;
    text-shadow: 1px 1px 1px #000;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 2px 4px rgba(0,0,0,.4);
}

.wood-btn:hover { background: linear-gradient(#8a693f, #6b4e2a); }

/* --- player filter dropdown --- */
.dropdown { position: relative; }

.dropdown-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    max-height: 320px;
    overflow-y: auto;
    background: #f6e3b4;
    border: 2px solid #5d4223;
    border-radius: 4px;
    box-shadow: 0 6px 16px rgba(0,0,0,.6);
    z-index: 50;
    padding: 6px;
}

.dropdown-list .dd-tools {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #b18e55;
    margin-bottom: 5px;
    padding-bottom: 5px;
}

.dropdown-list .dd-tools a {
    color: #5d4223;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
}

.dropdown-list label {
    display: block;
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 3px;
    white-space: nowrap;
}

.dropdown-list label:hover { background: #ecd69f; }
.dropdown-list input { margin-right: 7px; }

/* --- panels: wood frame + paper body, like game windows --- */
main { max-width: 1400px; margin: 22px auto; padding: 0 14px; }

.panel {
    background: #f6e3b4;
    border: 3px solid #2b1f10;
    border-radius: 6px;
    box-shadow: inset 0 0 0 2px #c9a45c, 0 5px 18px rgba(0,0,0,.6);
    margin-bottom: 26px;
    overflow: hidden;
}

.panel-title {
    background: linear-gradient(#5a3d20, #3b2510);
    color: #f0daae;
    font-family: Georgia, serif;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    padding: 8px 12px;
    text-shadow: 1px 1px 2px #000;
    border-bottom: 2px solid #c9a45c;
    letter-spacing: .5px;
}

.fresh-line {
    text-align: center;
    font-size: 12px;
    padding: 6px 10px;
    background: #ecd69f;
    border-bottom: 1px solid #b18e55;
    color: #3b2b1a;
}

.fresh-line .fresh { color: #07770b; font-weight: bold; }
.fresh-line .stale { color: #770707; font-weight: bold; }
.fresh-line .sep { color: #9a7b4f; margin: 0 6px; }

.panel-body { padding: 12px; overflow-x: auto; }

.login-body { text-align: center; padding: 26px; }
.login-body p { margin-bottom: 12px; }

.login-body input {
    font-family: inherit;
    font-size: 14px;
    padding: 8px 12px;
    border: 1px solid #5d4223;
    border-radius: 4px;
    background: #fff8e3;
    margin-right: 8px;
}

.error { color: #770707; font-weight: bold; margin-top: 10px; }

.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }

.name-filter {
    font-family: inherit;
    font-size: 13px;
    padding: 6px 10px;
    border: 1px solid #5d4223;
    border-radius: 4px;
    background: #fff8e3;
    min-width: 200px;
}

.status-line {
    text-align: center;
    color: #e8d5a3;
    font-size: 15px;
    text-shadow: 1px 1px 2px #000;
    margin: 30px 0;
}

/* --- the table: game tbl-content look, dark section-band headers --- */
table { border-collapse: collapse; width: 100%; }

th, td {
    border: 1px solid #b18e55;
    padding: 4px 8px;
    text-align: center;
    white-space: nowrap;
}

th {
    background: linear-gradient(#4a5158, #343a40);
    color: #f0f0f0;
    cursor: pointer;
    user-select: none;
    text-shadow: 1px 1px 1px #000;
    border-color: #2b2f33;
    vertical-align: middle;
}

th:hover { background: linear-gradient(#565e66, #40474e); }

th .sort-arrow { color: #c9a45c; font-size: 11px; }

.unit-ico {
    display: inline-block;
    width: 34px;
    height: 34px;
    vertical-align: middle;
    background-repeat: no-repeat;
}

tbody tr:nth-child(odd) { background: #f0dca8; }
tbody tr:nth-child(even) { background: #e8d093; }
tbody tr:hover { background: #ffefc2; }

td.cell-player { text-align: left; font-weight: bold; color: #074677; }
td.cell-village { text-align: left; font-weight: bold; }
td.cell-village .coords { color: #7a5a33; font-weight: normal; font-size: 11px; }
td.cell-tribe { font-weight: bold; }
td.not-loaded { color: #9a7b4f; font-style: italic; }

th.del-col { color: #ff9d9d; }

td.del-cell {
    color: #b30000;
    font-weight: bold;
    cursor: pointer;
    width: 30px;
}

td.del-cell:hover { background: #ffb8b8; }

tfoot td {
    background: linear-gradient(#c9a45c, #a9823d);
    font-weight: bold;
    border-top: 2px solid #5d4223;
    color: #2b2117;
}

.foot-note {
    text-align: center;
    color: #9a7b4f;
    font-size: 12px;
    padding: 18px;
}

.foot-note a { color: #7a5a33; text-decoration: underline; }
.foot-note a:hover { color: #5d4223; }

.hidden { display: none !important; }

/* --- simulateur de combat --- */
.sim-mods { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }

.sim-box {
    flex: 1 1 360px;
    min-width: 300px;
    border: 1px solid #b18e55;
    border-radius: 4px;
    background: #f0dca8;
    padding: 8px 12px 12px;
}

.sim-box legend {
    font-weight: bold;
    color: #5d4223;
    padding: 0 6px;
    font-size: 14px;
}

.sim-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px 12px;
}

.sim-grid label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
    font-weight: bold;
    color: #5d4223;
}

.sim-grid input[type=number], .sim-grid select {
    font-family: inherit;
    font-size: 13px;
    padding: 4px 6px;
    border: 1px solid #5d4223;
    border-radius: 3px;
    background: #fff8e3;
    color: #3b2b1a;
    width: 100%;
}

.sim-warn { color: #770707; font-size: 12px; font-weight: bold; margin-top: 8px; }

.sim-army-scroll { overflow-x: auto; margin-bottom: 14px; }

.sim-army input.sim-num {
    width: 62px;
    text-align: center;
    font-family: inherit;
    font-size: 13px;
    padding: 4px 2px;
    border: 1px solid #5d4223;
    border-radius: 3px;
    background: #fff8e3;
}

.sim-unit-label { font-size: 9px; font-weight: normal; margin-top: 2px; }

.sim-side { white-space: nowrap; }

.sim-clear {
    color: #ffd77a;
    font-size: 10px;
    font-weight: normal;
    cursor: pointer;
    text-decoration: underline;
}

.sim-prov { font-weight: bold; color: #074677; }

.sim-hint { text-align: center; color: #7a5a33; padding: 16px; font-style: italic; }

.sim-verdict {
    text-align: center;
    font-family: Georgia, serif;
    font-size: 17px;
    font-weight: bold;
    padding: 9px 12px;
    border-radius: 4px;
    margin-bottom: 10px;
    text-shadow: 1px 1px 1px rgba(255,255,255,.4);
}

.sim-v-att { background: #d9edc4; border: 1px solid #07770b; color: #07770b; }
.sim-v-def { background: #f3cfcf; border: 1px solid #770707; color: #770707; }
.sim-v-mut { background: #ecd69f; border: 1px solid #5d4223; color: #5d4223; }

.sim-summary {
    display: flex;
    gap: 8px 24px;
    flex-wrap: wrap;
    background: #ecd69f;
    border: 1px solid #b18e55;
    border-radius: 4px;
    padding: 7px 12px;
    margin-bottom: 10px;
    font-size: 12px;
}

.sim-res-title {
    background: linear-gradient(#4a5158, #343a40);
    color: #f0f0f0;
    font-weight: bold;
    text-align: center;
    padding: 6px 10px;
    border: 1px solid #2b2f33;
    border-bottom: none;
    text-shadow: 1px 1px 1px #000;
    margin-top: 14px;
}

/* colonnes homogènes entre les tableaux Attaquant et Défenseur : layout
   fixe, largeurs identiques pour le libellé et les provisions, le reste
   réparti à parts égales (les deux tableaux ont le même nombre de colonnes) */
.sim-restable { table-layout: fixed; width: 100%; }
.sim-restable col.sim-col-label { width: 120px; }
.sim-restable col.sim-col-prov { width: 90px; }

tr.sim-loss td { color: #b30000; font-weight: bold; }
tr.sim-resu td { color: #07770b; }
tr.sim-surv td { color: #07770b; font-weight: bold; }

/* --- villages (admin) : cartes « général » + tableaux détaillés --- */
.villages-overview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.ov-card {
    flex: 1 1 260px;
    background: linear-gradient(#f6e3b4, #ecd69f);
    border: 1px solid #b18e55;
    border-radius: 6px;
    padding: 10px 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .15);
}

.ov-name {
    font-weight: bold;
    font-size: 16px;
    color: #5d4223;
    border-bottom: 1px solid #c9a45c;
    padding-bottom: 6px;
    margin-bottom: 8px;
}

.ov-name .ov-world {
    font-weight: normal;
    font-size: 12px;
    color: #9a7b4f;
}

.ov-select {
    font-family: inherit;
    font-size: 16px;
    font-weight: bold;
    color: #5d4223;
    background: #fff8e3;
    border: 1px solid #5d4223;
    border-radius: 4px;
    padding: 3px 8px;
    cursor: pointer;
    max-width: 100%;
}

.ov-delete {
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(#b23636, #8a1f1f);
    border: 1px solid #5d1414;
    border-radius: 4px;
    padding: 4px 10px;
    margin-left: 10px;
    cursor: pointer;
    vertical-align: middle;
}
.ov-delete:hover { background: linear-gradient(#c94747, #a32626); }
.ov-delete:disabled { opacity: .6; cursor: default; }

/* ===== Sélecteur de compte (liste déroulante + étoiles) & barre Favoris ===== */
/* ligne STICKY : reste visible même en défilant */
.acct-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 4px;
    margin-bottom: 10px;
    position: sticky;
    top: 48px;
    z-index: 20;
    background: #ecdcb0;
    border-bottom: 1px solid #c9a45c;
}

/* liste déroulante personnalisée */
.acct-dd { position: relative; flex: 0 0 auto; }
.acct-dd-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-size: 16px;
    font-weight: bold;
    color: #5d4223;
    background: #fff8e3;
    border: 1px solid #5d4223;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    min-width: 160px;
    justify-content: space-between;
}
.acct-dd-caret { font-size: 12px; color: #9a7b4f; }
.acct-world { font-weight: normal; font-size: 12px; color: #9a7b4f; }

.acct-dd-panel {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    min-width: 240px;
    max-height: 320px;
    overflow-y: auto;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: #fbf1d2;
    border: 1px solid #5d4223;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
    z-index: 40;
}
.acct-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
}
.acct-item:hover { background: #efdcae; }
.acct-item.current { background: #e2c383; }
.acct-item-name { font-weight: bold; color: #5d4223; }
.acct-star {
    font-size: 16px;
    line-height: 1;
    color: #b9a05f;
    background: none;
    border: none;
    padding: 2px 4px;
    cursor: pointer;
}
.acct-star.on { color: #e0a900; }
.acct-star:hover { color: #e0a900; transform: scale(1.15); }

/* barre des favoris : une seule ligne, défilable si trop longue */
.fav-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    margin-left: auto;
    overflow-x: auto;
    white-space: nowrap;
    padding: 2px 0;
}
.fav-bar-lbl { font-size: 12px; font-weight: bold; color: #7a5a33; flex: 0 0 auto; }
.fav-bar-empty { font-size: 12px; color: #9a7b4f; font-style: italic; }
.fav-chip {
    flex: 0 0 auto;
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    color: #5d4223;
    background: linear-gradient(#f0dca8, #e2c383);
    border: 1px solid #b18e55;
    border-radius: 12px;
    padding: 3px 12px;
    cursor: pointer;
}
.fav-chip:hover { background: linear-gradient(#f6e6bd, #e8cc8f); }
.fav-chip.active {
    color: #fff8e3;
    background: linear-gradient(#3f9b45, #2f7a34);
    border-color: #235c28;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}

.ov-stats { display: flex; gap: 8px; flex-wrap: wrap; }

.ov-stat {
    flex: 1 1 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.ov-ico { font-size: 20px; line-height: 22px; }
.ov-val { font-size: 18px; font-weight: bold; color: #074677; }
.ov-lbl { font-size: 11px; color: #7a5a33; }
.ov-unknown { color: #b30000; font-weight: bold; }

.table-scroll { overflow-x: auto; }

.villages-table td.lvl-zero { color: #b9a06f; }
.villages-table th[data-vsort] { font-size: 12px; }

/* bascule Au village / Total de la sous-vue Unités */
.villages-metric { display: inline-flex; gap: 4px; margin-bottom: 10px; }
.villages-metric button {
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    padding: 5px 12px;
    color: #5d4223;
    background: linear-gradient(#f0dca8, #e2c383);
    border: 1px solid #5d4223;
    border-radius: 4px;
    cursor: pointer;
}
.villages-metric button.active {
    color: #fff8e3;
    background: linear-gradient(#8a693f, #6b4e2a);
}
.villages-metric-hint { font-size: 12px; color: #7a5a33; margin: -4px 0 10px; }

/* filtres Noble / Trébuchet du tableau Attaques (bouton vert quand actif) */
.attack-filter { display: inline-flex; gap: 6px; margin-bottom: 10px; }
.attack-filter button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    padding: 5px 12px;
    color: #5d4223;
    background: linear-gradient(#f0dca8, #e2c383);
    border: 1px solid #5d4223;
    border-radius: 4px;
    cursor: pointer;
}
.attack-filter button .unit-ico { width: 20px; height: 20px; }
.attack-filter button.active {
    color: #fff8e3;
    background: linear-gradient(#3f9b45, #2f7a34);
    border-color: #235c28;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}

/* infobulle des sources de soutien (vue Garnison) — défilable si longue */
/* bouton refresh de la barre du haut */
#refresh-round .nav-ico { transition: transform .2s; }
#refresh-round.spinning .nav-ico { animation: refresh-spin .6s linear; }
@keyframes refresh-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

tr.garrison-row { cursor: help; }
#garrison-tooltip {
    display: none;
    position: fixed;
    z-index: 9999;
    max-width: 720px;
    max-height: 320px;
    overflow: auto;
    background: #2b2117;
    color: #f6e3b4;
    border: 1px solid #c9a45c;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11px;
    line-height: 1.35;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .6);
}
#garrison-tooltip .gt-head {
    font-weight: bold;
    color: #f4d789;
    margin-bottom: 5px;
    border-bottom: 1px solid #5d4223;
    padding-bottom: 4px;
    position: sticky;
    top: -8px;
    background: #2b2117;
}
#garrison-tooltip .gt-empty { color: #d7c9a8; }
#garrison-tooltip .gt-list { list-style: none; margin: 0; padding: 0; }
#garrison-tooltip .gt-list li { padding: 2px 0; border-bottom: 1px dashed #4c3a22; white-space: nowrap; }
#garrison-tooltip .gt-list li:last-child { border-bottom: none; }
#garrison-tooltip .gt-who { font-weight: bold; color: #9ec7ff; }
#garrison-tooltip .coords { color: #c9a45c; font-weight: normal; font-size: 11px; }

.support-transit {
    font-size: 11px;
    font-weight: bold;
    color: #7a5a33;
    background: #e2c383;
    border: 1px solid #b18e55;
    border-radius: 3px;
    padding: 0 4px;
}

td.attack-target { color: #8a1f1f; }
td.attack-eta { font-size: 12px; color: #7a5a33; white-space: nowrap; }

.movement-count {
    font-weight: bold;
    color: #5d4223;
    margin-bottom: 10px;
    font-size: 14px;
}

/* activité récente : journal des actions */
.activity-list { display: flex; flex-direction: column; }
.activity-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 7px 10px;
    border-bottom: 1px dashed #d8bd80;
    border-left: 4px solid #b18e55;
    background: #f6e3b4;
}
.activity-item:nth-child(even) { background: #efd9a2; }
.activity-item.act-build { border-left-color: #a9823d; }
.activity-item.act-attack { border-left-color: #8a1f1f; }
.activity-item.act-support { border-left-color: #074677; }
.activity-item.act-other { border-left-color: #6b4e2a; }

/* rapport avec contenu dépliable */
details.report-detail { display: block; padding: 0; }
details.report-detail > summary {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 7px 10px;
    cursor: pointer;
    list-style: none;
}
details.report-detail > summary::-webkit-details-marker { display: none; }
details.report-detail > summary::before { content: '▸'; color: #a9823d; font-weight: bold; flex: none; }
details.report-detail[open] > summary::before { content: '▾'; }
.report-content {
    white-space: pre-wrap;
    word-break: break-word;
    color: #3b2b1a;
    font-size: 12px;
    padding: 6px 10px 10px 40px;
    border-top: 1px dashed #d8bd80;
    line-height: 1.5;
}
.act-ico { font-size: 16px; flex: none; }
.act-text { flex: 1; color: #3b2b1a; font-size: 13px; }
.act-village { color: #7a5a33; font-size: 12px; }
.act-time { color: #9a7b4f; font-size: 12px; white-space: nowrap; }
.activity-item .coords { color: #7a5a33; font-weight: normal; font-size: 11px; }

/* vue Rapports : simple compteur pour l'instant */
.reports-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 28px 14px;
    background: #f6e3b4;
    border: 1px solid #b18e55;
    border-radius: 8px;
}
.reports-ico { font-size: 40px; line-height: 1; }
.reports-total { font-size: 44px; font-weight: bold; color: #074677; }
.reports-lbl { font-size: 14px; color: #7a5a33; }
.reports-hint { font-size: 12px; color: #9a7b4f; margin-top: 6px; text-align: center; }

/* import « body webhook » */
.villages-import {
    background: #f6e3b4;
    border: 1px solid #b18e55;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 14px;
}
.villages-import summary {
    cursor: pointer;
    font-weight: bold;
    color: #5d4223;
}
.villages-import-hint { font-size: 12px; color: #7a5a33; margin: 8px 0; }
.villages-import-hint code { background: #ecd69f; padding: 1px 4px; border-radius: 3px; }
#villages-import-input {
    width: 100%;
    min-height: 90px;
    font-family: monospace;
    font-size: 12px;
    padding: 8px;
    border: 1px solid #5d4223;
    border-radius: 4px;
    background: #fff8e3;
    resize: vertical;
    box-sizing: border-box;
}
.villages-import-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.villages-import-status { font-size: 13px; font-weight: bold; color: #5d4223; }
.villages-import-status.ok { color: #07770b; }
.villages-import-status.err { color: #b30000; }

/* vue Messages : zone défilante dédiée pour que le bandeau de recherche
   (sticky) reste visible pendant le défilement des messages */
.messages-view {
    max-height: 68vh;
    overflow-y: auto;
    padding: 0 4px;
}

/* recherche dans la messagerie — reste collée en haut de la zone défilante */
.msg-search {
    display: flex;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 20;
    background: #f6e3b4;
    padding: 10px 4px;
    margin: 0 -4px 6px;
    border-bottom: 1px solid #c9a45c;
}
#msg-search-input {
    flex: 1;
    min-width: 160px;
    font-family: inherit;
    font-size: 13px;
    padding: 6px 10px;
    border: 1px solid #5d4223;
    border-radius: 4px;
    background: #fff8e3;
}
.msg-search-count { font-size: 12px; font-weight: bold; color: #7a5a33; min-width: 70px; text-align: center; }
.msg-search-nav {
    font-family: inherit;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    width: 30px;
    height: 30px;
    color: #fff8e3;
    background: linear-gradient(#7a5a33, #5d4223);
    border: 1px solid #5d4223;
    border-radius: 4px;
    cursor: pointer;
}
.msg-search-nav:hover { background: linear-gradient(#8a693f, #6b4e2a); }
mark.msg-hl { background: #ffe08a; color: inherit; border-radius: 2px; padding: 0 1px; }
mark.msg-hl.current { background: #ff9d3c; color: #2b2117; box-shadow: 0 0 0 2px rgba(255, 157, 60, .5); }

/* messagerie in-game */
.messages-list { display: flex; flex-direction: column; gap: 8px; }
.message-thread {
    background: #f6e3b4;
    border: 1px solid #b18e55;
    border-radius: 6px;
    /* pas d'overflow:hidden : il casserait le sticky de l'en-tête ci-dessous */
}
/* en-tête du fil : reste collé sous la barre de recherche pendant qu'on
   fait défiler les messages du fil déployé */
.message-thread > summary {
    cursor: pointer;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    list-style: none;
    position: sticky;
    top: 48px;
    z-index: 10;
    background: #f6e3b4;
    border-radius: 6px 6px 0 0;
    border-bottom: 1px solid #d8bd80;
}
.message-thread > summary::-webkit-details-marker { display: none; }
.message-thread > summary::before { content: '▸'; color: #a9823d; font-weight: bold; }
.message-thread[open] > summary::before { content: '▾'; }
.msg-title { font-weight: bold; color: #5d4223; flex: 1; }
.msg-parts { color: #7a5a33; font-size: 12px; }
.msg-count {
    font-size: 11px;
    font-weight: bold;
    color: #fff8e3;
    background: #8a693f;
    border-radius: 10px;
    padding: 1px 8px;
    white-space: nowrap;
}
.msg-posts { padding: 4px 12px 12px; border-top: 1px solid #d8bd80; }
.msg-post { padding: 8px 0; border-bottom: 1px dashed #d8bd80; }
.msg-post:last-child { border-bottom: none; }
.msg-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 3px; }
.msg-author { font-weight: bold; color: #074677; }
.msg-time { font-size: 11px; color: #9a7b4f; }
.msg-body { white-space: pre-wrap; word-break: break-word; color: #3b2b1a; font-size: 13px; line-height: 1.4; }

@media (max-width: 900px) {
    .top-bar h1 { font-size: 17px; }
    body { font-size: 11px; }
    th, td { padding: 3px 5px; }
    .unit-ico { transform: scale(.8); }
    .tab-links { gap: 4px; }
    .top-nav { flex-wrap: wrap; }
    .tab-links .tab-link { font-size: 14px; padding: 6px 8px; }
    .ov-card { flex-basis: 100%; }
}
