:root {
  font-family:
    Inter,
    Segoe UI,
    Arial,
    sans-serif;
  color: #e8edf8;
  background: #0b101b;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: radial-gradient(ellipse at 65% 0%, #1a2b43 0%, #0b101b 54%);
  min-height: 100vh;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.app {
  display: grid;
  grid-template-columns: 238px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: #0c1422e8;
  border-right: 1px solid #26364b;
  padding: 25px 15px;
  display: flex;
  flex-direction: column;
  gap: 23px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 10px;
}
.crest {
  font-size: 29px;
  color: #d8ba7b;
}
.brand strong {
  font-family: Georgia, serif;
  font-size: 28px;
  letter-spacing: 3px;
  color: #f0d69b;
}
.brand small {
  display: block;
  letter-spacing: 2px;
  color: #7489a5;
  font-size: 9px;
  margin-top: 4px;
}
.nav {
  display: grid;
  gap: 5px;
}
.nav button {
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  padding: 13px 15px;
  border-radius: 9px;
  color: #9aaec8;
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav button.active,
.nav button:hover {
  color: #f3dbab;
  background: #22314a;
  border-color: #405371;
}
.nav button span {
  font-size: 18px;
}
.sidefoot {
  margin-top: auto;
  color: #72839c;
  font-size: 12px;
  padding: 12px;
  line-height: 1.8;
}
.main {
  padding: 30px 36px;
  max-width: 1600px;
  width: 100%;
  margin: auto;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
  gap: 12px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-size: 10px;
  color: #c5a46b;
}
.top h1 {
  font-family: Georgia, serif;
  font-size: 33px;
  font-weight: 500;
  margin: 6px 0;
  color: #f4e5c5;
}
.topright {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chip {
  border: 1px solid #3b4d64;
  background: #172338;
  border-radius: 20px;
  padding: 9px 13px;
  color: #dfc38d;
}
.panel {
  background: linear-gradient(145deg, #19263a, #121c2c);
  border: 1px solid #34445b;
  border-radius: 13px;
  padding: 20px;
  box-shadow: 0 15px 45px #0002;
}
.panel h2 {
  font-family: Georgia, serif;
  color: #e7cc94;
  font-weight: 500;
  margin: 0 0 16px;
  font-size: 20px;
}
.layout {
  display: grid;
  grid-template-columns: minmax(310px, 1fr) minmax(270px, 0.8fr) minmax(300px, 1fr);
  gap: 17px;
}
.stack {
  display: grid;
  gap: 17px;
  align-content: start;
}
.portrait {
  height: 330px;
  border-radius: 10px;
  border: 1px solid #46546a;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #4b627b, #19283d 65%, #0c1423);
  display: flex;
  align-items: center;
  justify-content: center;
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.portrait .placeholder {
  font-size: 130px;
  opacity: 0.45;
}
.portrait label {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: #111b2bde;
  padding: 9px 12px;
  border: 1px solid #71819a;
  border-radius: 7px;
  cursor: pointer;
}
.portrait input {
  display: none;
}
.hero-name {
  font-family: Georgia, serif;
  font-size: 24px;
  color: #f3dbad;
  margin: 16px 0 5px;
}
.muted {
  color: #8ea0ba;
}
.barline {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin: 13px 0 5px;
}
.bar {
  height: 9px;
  background: #0b1422;
  border-radius: 20px;
  overflow: hidden;
}
.bar > div {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, #8c293a, #dc5262);
}
.bar.mana > div {
  background: linear-gradient(90deg, #2b5fa4, #53a6e3);
}
.stat {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #2b394e;
  padding: 10px 0;
}
.stat:last-child {
  border: 0;
}
.stat b {
  color: #e5cf9f;
}
.slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}
.slot {
  height: 87px;
  background: #0e192a;
  border: 1px solid #435572;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  position: relative;
  color: #92a7c0;
}
.slot:hover {
  border-color: #d9bd7c;
  background: #20334b;
}
.slot .emoji {
  font-size: 26px;
}
.slot small {
  font-size: 10px;
  text-align: center;
  max-width: 95%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slot.equipped {
  border-color: #a58852;
  background: #263045;
}
.slot .tiny {
  position: absolute;
  right: 4px;
  top: 3px;
  font-size: 9px;
  color: #d9bd7c;
}
.itemgrid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.item {
  aspect-ratio: 1;
  min-height: 51px;
  border: 1px solid #41516b;
  background: #0c1727;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  position: relative;
}
.item:hover {
  border-color: #e0bc79;
  background: #24344c;
}
.item em {
  position: absolute;
  bottom: 3px;
  right: 5px;
  font-style: normal;
  font-size: 10px;
  color: #cdd7e4;
}
.item[data-quality="Subtil"],
.quality-subtil {
  border-color: #48c878 !important;
  box-shadow: inset 0 0 15px #3aca7633;
}
.item[data-quality="Pur"],
.quality-pur {
  border-color: #51a9ff !important;
  box-shadow: inset 0 0 18px #3997ff55;
}
.item[data-quality="Parfait"],
.quality-parfait {
  border-color: #bb79fa !important;
  box-shadow: inset 0 0 21px #ad62f077;
}
.item[data-quality="Unique"],
.quality-unique {
  border-color: #ffa84e !important;
  box-shadow: inset 0 0 24px #ed882b88;
}
.item[data-quality="Légendaire"],
.quality-légendaire {
  border-color: #ffe46c !important;
  box-shadow: inset 0 0 28px #ffda4388;
  background-image: radial-gradient(ellipse at top, #9d7a2b44, transparent);
}
.item.rare {
  border-color: #7453a6;
}
.item.uncommon {
  border-color: #387e67;
}
.btn {
  background: #c6a66c;
  border: 1px solid #e2c78c;
  color: #172033;
  padding: 10px 14px;
  border-radius: 7px;
  font-weight: 700;
}
.btn:hover {
  background: #e0c58c;
}
.btn.secondary {
  background: #23354e;
  border-color: #526683;
  color: #e4edf8;
}
.btn.danger {
  background: #572b36;
  border-color: #8a4a5b;
  color: #ffdae0;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 15px;
}
.hint {
  font-size: 12px;
  color: #9aabc0;
  line-height: 1.6;
}
.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 13px;
}
.product {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.producthead {
  display: flex;
  align-items: center;
  gap: 12px;
}
.producticon {
  width: 50px;
  height: 50px;
  border-radius: 9px;
  background: #101c2e;
  border: 1px solid #53617a;
  display: grid;
  place-items: center;
  font-size: 27px;
}
.product b {
  color: #f0dbb0;
}
.product small {
  color: #9db0c9;
}
.product .actions {
  margin-top: auto;
  justify-content: space-between;
  align-items: center;
}
.section {
  display: none;
}
.section.active {
  display: block;
}
.fullgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 17px;
}
.input {
  width: 100%;
  background: #0d192b;
  border: 1px solid #4b5e7a;
  color: #edf1fa;
  padding: 11px;
  border-radius: 7px;
  margin: 7px 0 12px;
}
.toast {
  position: fixed;
  bottom: 22px;
  right: 25px;
  background: #273c51;
  border: 1px solid #c3a76d;
  padding: 14px 20px;
  border-radius: 9px;
  box-shadow: 0 12px 30px #0008;
  max-width: 350px;
  z-index: 60;
}
.hidden {
  display: none;
}
.building {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.tag {
  display: inline-block;
  border: 1px solid #485d77;
  border-radius: 20px;
  padding: 5px 9px;
  color: #aebed4;
  font-size: 11px;
}
.notice {
  background: #26344a;
  border-left: 3px solid #c6a66c;
  padding: 12px 15px;
  border-radius: 4px;
  color: #b7c6da;
  line-height: 1.6;
}
.log {
  font-size: 12px;
  color: #b5c3d5;
  line-height: 2;
  border-bottom: 1px solid #29394e;
}
.empty {
  color: #8394ac;
  text-align: center;
  padding: 30px 10px;
}
.modalbg.hidden {
  display: none;
}
.modalbg {
  position: fixed;
  inset: 0;
  background: #000b;
  display: grid;
  place-items: center;
  z-index: 9;
  padding: 20px;
}
.modal {
  width: min(460px, 100%);
  background: #1a283b;
  border: 1px solid #66748a;
  border-radius: 12px;
  padding: 23px;
}
.modal h2 {
  color: #f0d7a3;
  margin-top: 0;
}
.modal p {
  color: #b9c7da;
  line-height: 1.6;
}
.subheading {
  font-size: 12px;
  color: #93a9c5;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 12px 0;
}
.currency {
  color: #f3d38d;
}
@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 1fr 1fr;
  }
  .layout > .stack:last-child {
    grid-column: 1/-1;
  }
}
@media (max-width: 750px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    padding: 12px;
    gap: 9px;
  }
  .brand {
    justify-content: center;
  }
  .nav {
    display: flex;
    overflow: auto;
  }
  .nav button {
    white-space: nowrap;
    padding: 9px;
  }
  .sidefoot {
    display: none;
  }
  .main {
    padding: 18px;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .layout > .stack:last-child {
    grid-column: auto;
  }
  .top h1 {
    font-size: 25px;
  }
  .portrait {
    height: 260px;
  }
}

.portrait img {
  object-fit: contain;
  object-position: center;
  background: #101a29;
}
.portrait {
  background: #0e1828;
}
.panelbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.panelbar h2 {
  margin: 0;
}
.editfield {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.editfield label {
  font-size: 12px;
  color: #aebed4;
}
.editfield .input {
  margin: 5px 0;
}
.moneyline {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.coin {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  border: 1px solid #40526b;
  background: #111e30;
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 12px;
}
.coin strong {
  color: #f2d89b;
}
.mini {
  font-size: 11px;
  color: #9fb0c9;
}
.badgebar {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}
.progress {
  height: 7px;
  background: #0b1422;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 7px;
}
.progress > div {
  background: #d6b16b;
  height: 100%;
}
.playerrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px;
  border: 1px solid #34465e;
  background: #111d2e;
  border-radius: 9px;
  margin-bottom: 10px;
}
.mastertools {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.editpanel {
  border-color: #c6a66c;
  margin-bottom: 15px;
}
.locked {
  opacity: 0.65;
}
.warning {
  color: #f0b0a0;
}
.negostatus {
  padding: 13px;
  background: #101d2f;
  border-radius: 8px;
  border: 1px solid #41516a;
  margin-bottom: 16px;
}
.tinybutton {
  padding: 7px 10px;
  font-size: 12px;
}
.rolepicker {
  background: #0e1b2c;
  color: #d7e2f2;
  border: 1px solid #4a5d76;
  border-radius: 8px;
  padding: 8px;
}
.rolehint {
  font-size: 11px;
  color: #96a7c0;
}
.slot small {
  white-space: normal;
  line-height: 1.2;
}
.playerrow strong {
  color: #e8d2a4;
}
.modal {
  max-height: 90vh;
  overflow: auto;
}

.diamond-coin {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 2px solid #91e8fa;
  background: radial-gradient(circle at 30% 25%, #e0fbff, #36a7ce 60%, #1b577a);
  box-shadow: inset 0 0 0 2px #b3f2ff;
  color: #efffff;
  font-size: 11px;
  text-shadow: 0 0 2px #fff;
}
.coin {
  white-space: nowrap;
}
.product .actions {
  flex-wrap: wrap;
}
.product label {
  display: block;
  margin: 8px 0;
}
.product input[type="checkbox"] {
  accent-color: #d6b16b;
}
.playerrow {
  flex-wrap: wrap;
}
.rolepicker {
  max-width: 200px;
}

.topright {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.selectorbox {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 195px;
}
.selectorbox small {
  color: #b9c8db;
}
.coin-medal {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 2px solid var(--edge);
  background: radial-gradient(circle at 30% 22%, var(--light), var(--mid) 60%, var(--dark));
  box-shadow: inset 0 0 0 2px #ffffff50;
  color: #fff;
  font-size: 10px;
  text-shadow: 0 1px 2px #000;
}
.modalbg {
  place-items: initial;
}
.modal {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(490px, calc(100vw - 30px));
  box-shadow: 0 18px 70px #0009;
}
.modal.dragged {
  transform: none;
}
.draghandle {
  cursor: move;
  user-select: none;
  touch-action: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #44546b;
  padding-bottom: 9px;
  margin-bottom: 10px;
  color: #e9cf97;
}
.draghandle button {
  background: none;
  border: 0;
  color: #eee;
  font-size: 22px;
}
.craftcard {
  border: 1px solid #415675;
  background: #0e1929;
  border-radius: 9px;
  padding: 13px;
  margin-bottom: 10px;
}
.tabnote {
  font-size: 12px;
  color: #a9b9cf;
}
.imgtiny {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 6px;
}
.inlineflex {
  display: flex;
  align-items: center;
  gap: 10px;
}
.smalltextarea {
  min-height: 70px;
  resize: vertical;
}

/* v0.1.7 : les qualités décorent sans modifier le cadre */
.item[data-quality],
.quality-subtil,
.quality-pur,
.quality-parfait,
.quality-unique,
.quality-légendaire {
  border-color: #41516b !important;
  box-shadow: none !important;
  background-image: none !important;
}
.quality-subtil:after,
.quality-pur:after,
.quality-parfait:after,
.quality-unique:after,
.quality-légendaire:after {
  position: absolute;
  left: 4px;
  top: 1px;
  font-size: 12px;
  pointer-events: none;
  text-shadow:
    0 0 4px #000,
    0 0 7px currentColor;
}
.quality-subtil:after {
  content: "✧";
  color: #48c878;
}
.quality-pur:after {
  content: "✦";
  color: #51a9ff;
}
.quality-parfait:after {
  content: "✦ ✧";
  color: #bb79fa;
}
.quality-unique:after {
  content: "✦ ✧ ✦";
  color: #ffa84e;
}
.quality-légendaire:after {
  content: "✦ ✦ ✦ ✦";
  color: #ffe46c;
}
.shop-title {
  margin: 0 0 18px;
  color: #e7cc94;
  font:
    normal 24px Georgia,
    serif;
}
.stat-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #afc1d7;
  font-size: 12px;
}
.stat-toggle input {
  accent-color: #c6a66c;
}
.collapse-toggle {
  float: right;
}
.instance-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.instance-fields label {
  font-size: 12px;
  color: #afc1d7;
}
.quality-config-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 95px 95px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #34445b;
  padding: 5px 0;
}
.quality-config-row .input {
  margin: 3px 0;
}
.quality-config-row label {
  font-size: 12px;
  color: #c8d5e8;
}
@media (max-width: 600px) {
  .quality-config-row {
    grid-template-columns: 1fr 1fr;
  }
  .quality-config-row label:first-child {
    grid-column: 1/-1;
  }
}
.shop-filters {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 12px 0 20px;
}
.shop-filters .btn {
  white-space: nowrap;
}
.producticon[data-shop-detail] {
  cursor: pointer;
  border: 1px solid #607493;
  border-radius: 10px;
  background: transparent;
  color: inherit;
}
.producticon[data-shop-detail]:hover {
  outline: 2px solid #c5a46c;
}
#mineControls label {
  display: block;
  margin-bottom: 12px;
}
#mineControls .input {
  margin-top: 6px;
}
#itemAdmin .detail-block {
  margin-top: 14px;
}
#oreEditCards {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #40536d;
  border-radius: 12px;
}
#oreEditCards button {
  margin: 4px;
}
#pantheonList .playerrow {
  margin: 7px 0;
}
#accountsList .detail-block {
  margin: 12px 0;
}
.item-detail-meta {
  color: #d9c398;
  margin: 12px 0 18px;
  display: flex;
  gap: 12px;
}
.detail-block {
  background: #111e30;
  border: 1px solid #3b506b;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 14px 0;
}
.detail-block h3 {
  margin: 0 0 12px;
  color: #e6cd99;
  font-size: 15px;
  font-weight: 600;
}
.detail-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid #2b3d55;
}
.detail-stat:last-child {
  border-bottom: 0;
}
.detail-stat span {
  color: #b6c5da;
}
.detail-stat strong {
  color: #f0d8a8;
  text-align: right;
}
.detail-description {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0 0 12px !important;
}
.modal {
  width: min(560px, calc(100vw - 30px));
}
.enchant-choice {
  display: flex;
  width: 100%;
  align-items: center;
  text-align: left;
  gap: 16px;
  background: #142238;
  color: #f1e1c3;
  border: 1px solid #405a79;
  border-radius: 10px;
  padding: 15px;
  margin: 10px 0;
}
.enchant-choice:hover {
  border-color: #d9b778;
  background: #20344f;
}
.enchant-choice-icon {
  font-size: 32px;
  width: 50px;
  text-align: center;
}
.enchant-choice small {
  display: block;
  color: #9eafc6;
  margin-top: 7px;
}
.enchant-arrow {
  margin-left: auto;
  font-size: 22px;
  color: #d4ba85;
}
.enchant-stage {
  text-align: center;
  padding: 18px 0;
}
.enchant-stage h2 {
  margin: 14px 0 4px;
}
.enchant-orb {
  width: 100px;
  height: 100px;
  display: grid;
  place-items: center;
  margin: auto;
  font-size: 48px;
  border-radius: 50%;
  border: 2px solid #ad8e5d;
  background: radial-gradient(circle, #34486a, #101c2e);
  box-shadow: 0 0 24px #e3b66c44;
}
.enchant-rolling {
  animation: enchantPulse 0.45s ease-in-out infinite alternate;
}
.enchant-result {
  color: #f1d99e;
  text-align: center;
  min-height: 24px;
  margin: 12px 0;
  font-weight: 600;
}
.ward-choice {
  display: block;
  margin: 14px 0;
  color: #d5e0ee;
}
@keyframes enchantPulse {
  from {
    transform: scale(0.92) rotate(-8deg);
    box-shadow: 0 0 12px #7c9ee877;
    filter: brightness(0.9);
  }
  to {
    transform: scale(1.14) rotate(8deg);
    box-shadow: 0 0 52px #f7c05dbb;
    filter: brightness(1.55);
  }
}
@media (prefers-reduced-motion: reduce) {
  .enchant-rolling {
    animation: none;
  }
}
.shop-filters {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 12px 0 20px;
}
.shop-filters .btn {
  white-space: nowrap;
}
.producticon[data-shop-detail] {
  cursor: pointer;
  border: 1px solid #607493;
  border-radius: 10px;
  background: transparent;
  color: inherit;
}
.producticon[data-shop-detail]:hover {
  outline: 2px solid #c5a46c;
}
#mineControls label {
  display: block;
  margin-bottom: 12px;
}
#mineControls .input {
  margin-top: 6px;
}
#itemAdmin .detail-block {
  margin-top: 14px;
}
.quality-subtil,
.quality-pur,
.quality-parfait,
.quality-unique,
.quality-légendaire {
  position: relative;
}
.quality-parfait:after,
.quality-unique:after,
.quality-légendaire:after {
  content: "✧";
  position: absolute;
  top: 2px;
  left: 5px;
  font-size: 12px;
  color: inherit;
  pointer-events: none;
}
.quality-unique:after {
  content: "✦ ✧";
}
.quality-légendaire:after {
  content: "✦ ✧ ✦";
}
.quality-legend {
  padding: 8px 11px;
  border: 1px solid #435775;
  border-radius: 7px;
  margin: 6px 0;
  display: flex;
  justify-content: space-between;
}
.fxstage {
  position: relative;
  overflow: hidden;
}
.fxstage .particle {
  position: absolute;
  left: 50%;
  top: 42%;
  font-size: 22px;
  pointer-events: none;
  animation: burst 1.2s ease-out forwards;
}
.fx-success .particle {
  color: #ffe78e;
}
.fx-smoke .particle {
  color: #9eafc4;
  filter: blur(2px);
}
.fx-break .particle {
  color: #ffad58;
}
.fx-protected .particle {
  color: #6fd8ff;
}
.fx-break .enchant-orb {
  animation: shatter 0.65s ease-in forwards;
}
.fx-protected .enchant-orb {
  animation: shield 0.75s ease-out;
}
.fx-success .enchant-orb {
  box-shadow: 0 0 45px #ffd56d;
}
.fx-smoke .enchant-orb {
  filter: grayscale(0.8);
}
@keyframes burst {
  from {
    opacity: 1;
    transform: translate(0, 0) scale(0.3);
  }
  to {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(1.5);
  }
}
@keyframes shatter {
  45% {
    transform: scale(1.18) rotate(10deg);
    filter: brightness(2);
  }
  100% {
    transform: scale(0.1) rotate(-40deg);
    opacity: 0;
  }
}
@keyframes shield {
  40% {
    box-shadow: 0 0 0 26px #3faaff88;
    transform: scale(1.15);
  }
  100% {
    box-shadow: 0 0 0 42px #3faaff00;
    transform: scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .fxstage .particle,
  .fxstage .enchant-orb {
    animation: none !important;
  }
}
.shop-filters {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 12px 0 20px;
}
.shop-filters .btn {
  white-space: nowrap;
}
.producticon[data-shop-detail] {
  cursor: pointer;
  border: 1px solid #607493;
  border-radius: 10px;
  background: transparent;
  color: inherit;
}
.producticon[data-shop-detail]:hover {
  outline: 2px solid #c5a46c;
}
#mineControls label {
  display: block;
  margin-bottom: 12px;
}
#mineControls .input {
  margin-top: 6px;
}
#itemAdmin .detail-block {
  margin-top: 14px;
}
/* v0.1.14 : accueil et panneaux de gestion */
.home-hero {
  background: linear-gradient(130deg, #182a43, #111b2d);
  border: 1px solid #455b78;
  border-radius: 16px;
  padding: 38px;
  max-width: 980px;
  margin: 0 auto 20px;
}
.home-hero h2 {
  font-family: Georgia, serif;
  font-size: 36px;
  color: #f0d8a4;
  margin: 0 0 16px;
}
.home-hero p {
  line-height: 1.8;
  color: #c3d1e3;
  font-size: 15px;
  max-width: 730px;
}
.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  max-width: 980px;
  margin: 0 auto;
}
.home-cards .panel {
  padding: 23px;
}
.mine-result {
  min-width: 100px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 1px solid #ad9365;
  border-radius: 10px;
  background: #17263b;
  color: #e9d09e;
  font-size: 24px;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}
.mine-result.rolling {
  animation: minePulse 0.16s linear infinite alternate;
}
@keyframes minePulse {
  to {
    background: #344760;
    transform: translateY(-2px);
  }
}
#craftList .currency[data-edit-craft-price] {
  cursor: pointer;
  border-bottom: 1px dashed #d6b16b;
  padding: 6px 3px;
}
#craftList .currency[data-edit-craft-price]:hover {
  color: #fff;
}
#role[hidden] {
  display: none !important;
}
.material-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.material-tools input {
  width: 85px;
}
#oreEditCards [data-edit-ore] {
  cursor: grab;
  touch-action: none;
  user-select: none;
}
#oreEditCards [data-edit-ore].dragging {
  cursor: grabbing;
  opacity: 0.65;
  outline: 2px dashed #d6b16b;
}

.npc-tag {
  color: #9fc2ff;
  font-weight: 600;
  font-size: 0.85em;
}
.linkbtn {
  background: none;
  border: 0;
  padding: 0;
  color: #e9c46a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.linkbtn:hover {
  color: #fff;
}
.accounts-scroll {
  position: relative;
  overflow-y: auto;
  border: 1px solid #34445b;
  border-radius: 10px;
  padding: 0 10px;
  margin: 12px 0;
  scrollbar-color: #526683 #0d192b;
}
.account-card {
  margin: 10px 0;
}
#accountSearch {
  width: 100%;
  margin-top: 8px;
}
.quest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.quest-card {
  border: 1px solid #34445b;
  border-radius: 12px;
  overflow: hidden;
  background: #0d192b;
  display: flex;
  flex-direction: column;
}
.quest-img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}
.quest-body {
  padding: 14px;
}
.quest-card .quest-title {
  margin: 0 0 6px;
}
.quest-card .detail-description,
#modal .detail-description {
  white-space: pre-wrap;
}
.quest-itempick {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}
.quest-itempick select {
  flex: 1;
  min-width: 0;
}
.quest-itempick input {
  width: 80px;
}
#questImagePreview .quest-img {
  max-width: 320px;
  border-radius: 8px;
  margin: 8px 0;
}
.sheet-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 10px 0;
}
.sheet-portrait {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #34445b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  background: #0d192b;
  flex: none;
}

.quest-imgwrap,
.monster-imgwrap {
  display: block;
  width: 100%;
  height: 210px;
  padding: 0;
  border: 0;
  background: #070f1c;
  cursor: zoom-in;
  overflow: hidden;
}
.quest-imgwrap img,
.monster-imgwrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.quest-img {
  object-fit: contain;
  background: #070f1c;
}
.monster-imgwrap.empty {
  display: grid;
  place-items: center;
  font-size: 3rem;
  cursor: default;
}
.monster-card {
  border: 1px solid #34445b;
  border-radius: 12px;
  overflow: hidden;
  background: #0d192b;
  display: flex;
  flex-direction: column;
}
.monster-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 6px;
  margin: 10px 0;
}
.monster-stat {
  background: #101c2e;
  border: 1px solid #34445b;
  border-radius: 8px;
  padding: 6px 8px;
  min-width: 0;
}
.monster-stat small {
  display: block;
  color: #8ea0ba;
  font-size: 0.7rem;
}
.monster-stat strong {
  overflow-wrap: anywhere;
}
.monster-text {
  white-space: pre-wrap;
}
.unknown {
  color: #6d7e99;
  letter-spacing: 2px;
}
#modal.wide {
  width: min(92vw, 980px);
  max-width: none;
}
.viewer {
  text-align: center;
}
.viewer img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 8px;
}
.sheet-portrait-btn {
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  flex: none;
}
.kn-list {
  max-height: 55vh;
  overflow-y: auto;
  margin: 10px 0;
}
.kn-row {
  border: 1px solid #34445b;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.kn-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
}
.log-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.log-scroll {
  max-height: 420px;
  overflow-y: auto;
  margin-top: 8px;
}
.assign-list {
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid #34445b;
  border-radius: 8px;
  padding: 6px 10px;
  margin: 6px 0;
}
.assign-list label {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 3px 0;
}
#bestiarySearch {
  width: 100%;
  margin: 8px 0;
}

.assign-list {
  max-height: 208px;
  overflow-y: auto;
  padding: 6px;
}
.pick {
  display: block;
  width: 100%;
  height: 36px;
  margin: 0 0 4px;
  padding: 0 10px;
  text-align: left;
  border: 1px solid #34445b;
  border-radius: 8px;
  background: #101c2e;
  color: inherit;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pick:hover {
  border-color: #c5a46c;
}
.pick.selected {
  background: #3a3220;
  border-color: #e9c46a;
  color: #ffe9a8;
}
#questAssignSearch {
  width: 100%;
}

.playerrow.dead {
  border: 1px solid #b3382f;
  background: rgba(120, 24, 20, 0.28);
}
.playerrow.dead .linkbtn {
  color: #ff9d93;
}
.playerrow.inactive {
  border: 1px solid #e8892b;
  background: rgba(232, 137, 43, 0.16);
}
.playerrow.inactive .linkbtn {
  color: #ffb866;
}

.bag-picker {
  flex: 1 1 100%;
  min-width: 220px;
}
.bag-picker .input {
  width: 100%;
}

.test-opt {
  color: #9fd6ff;
}

.log-changes {
  margin: 4px 0 0 18px;
  padding: 0;
}
.log-changes li {
  margin: 2px 0;
}
.roll-row span {
  padding-left: 10px;
  color: #b9c8d9;
}

.zoomable {
  cursor: zoom-in;
}
.zoomov {
  position: fixed;
  inset: 0;
  background: #000d;
  z-index: 40;
  display: grid;
  place-items: center;
  cursor: zoom-out;
  padding: 20px;
}
.zoomov figure {
  margin: 0;
  text-align: center;
}
.zoomov img {
  max-width: 92vw;
  max-height: 84vh;
  border-radius: 8px;
  background: #0b101b;
  box-shadow: 0 10px 50px #000;
}
.zoomov figcaption {
  margin-top: 10px;
  color: #c9d6e8;
  font-size: 13px;
}
.icon-edit-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.icon-preview {
  flex: none;
  width: 58px;
  height: 58px;
  border: 1px solid #53617a;
  border-radius: 9px;
  background: #101c2e;
  display: grid;
  place-items: center;
  font-size: 30px;
  overflow: hidden;
}
.icon-preview .imgtiny {
  width: 54px;
  height: 54px;
}
.icon-edit-row > div {
  flex: 1;
  min-width: 0;
}
.icon-inline {
  width: 22px;
  height: 22px;
  vertical-align: middle;
}
.passive-row strong {
  color: #8fd6a8;
}

.item[data-rarity],
.slot[data-rarity],
.producticon[data-rarity],
.enchant-choice-icon[data-rarity],
.rarity-frame[data-rarity] {
  border: 2px solid var(--rc) !important;
}
.rarity-frame {
  display: inline-grid;
  place-items: center;
  padding: 3px;
  border-radius: 9px;
  background: #101c2e;
  vertical-align: middle;
  min-width: 36px;
  min-height: 36px;
}
.enchant-choice-icon[data-rarity] {
  border-radius: 8px;
}
.quality-subtil:after {
  content: "★";
  color: #48c878;
}
.quality-pur:after {
  content: "★";
  color: #51a9ff;
}
.quality-parfait:after {
  content: "★";
  color: #bb79fa;
}
.quality-unique:after {
  content: "★ ★";
  color: #ffa84e;
}
.quality-légendaire:after {
  content: "★ ★ ★";
  color: #ffe46c;
}

/* ===== Mécaniques / Sorts / Combat ===== */
details.mech {
  border: 1px solid #34445b;
  background: #111d2e;
  border-radius: 9px;
  margin: 8px 0;
  padding: 0 14px;
}
details.mech > summary {
  cursor: pointer;
  padding: 13px 0;
  font-weight: 700;
  color: #f0dbb0;
}
.mech-body {
  white-space: pre-wrap;
  line-height: 1.7;
  color: #cfd9e8;
  max-height: 440px;
  overflow: auto;
  padding: 4px 4px 8px;
}
details.mech > .actions {
  margin: 0 0 12px;
}
.spell-filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}
.spell-filters .input {
  margin: 0;
}
.spell-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 13px;
}
.spell-card.known {
  border-color: #5aa77d;
}
.spell-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}
.spell-title b {
  color: #f0dbb0;
}
.spell-counters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag.full {
  border-color: #c46a6a;
  color: #ffb3b3;
}
.passive-note {
  color: #8fd6a8;
}
.cb-pickers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.cb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 13px;
}
.cb-card {
  border: 1px solid #435572;
  background: #0e192a;
  border-radius: 11px;
  padding: 13px;
  transition: opacity 0.2s;
}
.cb-card.cb-monster {
  border-color: #7a4650;
}
.cb-card.cb-npc {
  border-color: #5d6fa0;
}
.cb-card.done {
  opacity: 0.4;
  filter: grayscale(1);
}
.cb-card.ko {
  border-color: #a33a3a;
}
.cb-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.cb-head > div {
  flex: 1;
  min-width: 0;
}
.cb-head b {
  display: block;
  color: #f0dbb0;
}
.cb-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 9px;
  background: #101c2e;
  border: 1px solid #53617a;
  display: grid;
  place-items: center;
  font-size: 24px;
  overflow: hidden;
}
.cb-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cb-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 12px;
  color: #aebed4;
  margin: 10px 0;
}
.cb-stats .up b {
  color: #7ed3a6;
}
.cb-stats .down b {
  color: #ff9aa5;
}
.cb-buffs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
.cb-buff {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid currentColor;
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 11px;
}
.cb-buff em {
  font-style: normal;
  opacity: 0.8;
}
.cb-buff button {
  background: none;
  border: 0;
  color: inherit;
  padding: 0 0 0 2px;
  font-size: 14px;
}
.fx-buff {
  color: #7ed3a6;
}
.fx-debuff {
  color: #ff9aa5;
}
.cb-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.cb-sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.dice-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.dice-btn {
  width: 62px;
  padding: 8px 0;
  border: 1px solid #526683;
  background: #142238;
  color: #e4edf8;
  border-radius: 9px;
  display: grid;
  gap: 2px;
  text-align: center;
}
.dice-btn b {
  font-size: 20px;
}
.dice-btn small {
  color: #9db0c9;
}
.dice-btn.selected {
  background: #c6a66c;
  border-color: #e2c78c;
  color: #172033;
}
.dice-btn.selected small {
  color: #2c3647;
}
.cb-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 10px 0;
}
.cb-result {
  border: 1px solid #435572;
  border-radius: 9px;
  padding: 12px;
  background: #0e192a;
  line-height: 1.8;
  margin-top: 10px;
}
.cb-result h3 {
  margin: 0 0 6px;
}
.cb-total {
  font-size: 26px;
  font-weight: 700;
  color: #ff9aa5;
  margin-top: 8px;
}
.cb-total.heal {
  color: #7ed3a6;
}
.passive-box {
  border-left: 3px solid #8fd6a8;
  background: #16273a;
  padding: 10px 14px;
  margin-top: 10px;
  border-radius: 4px;
  line-height: 1.6;
}
@media (max-width: 800px) {
  .cb-pickers,
  .spell-filters {
    grid-template-columns: 1fr;
  }
}

.cb-pickers.hidden {
  display: none;
}

.tag.live {
  border-color: #5aa77d;
  color: #8fd6a8;
  margin-left: 8px;
  font-size: 11px;
}
.cb-card[draggable="true"] {
  cursor: grab;
}
.cb-card.dragging {
  opacity: 0.45;
}
.cb-card.drop-target {
  outline: 2px dashed #c6a66c;
  outline-offset: 3px;
}
.fx-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 0.8fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.fx-row .input {
  margin: 0;
}
@media (max-width: 800px) {
  .fx-row {
    grid-template-columns: 1fr 1fr;
  }
}
.item-tip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  max-width: 260px;
  min-width: 170px;
  background: #0f1724ee;
  border: 1px solid #435775;
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: 0 6px 20px #000a;
  font-size: 12.5px;
  line-height: 1.35;
}
.item-tip .tip-name {
  font-weight: 700;
  font-size: 14px;
}
.item-tip .tip-meta {
  color: #c8d5e8;
  margin-bottom: 4px;
}
.item-tip .tip-stat {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid #2c3b52;
  padding: 2px 0;
}
.item-tip .tip-stat b {
  white-space: nowrap;
}

.monster-card[data-mr] {
  border: 2px solid var(--mc) !important;
  box-shadow: 0 0 12px var(--mc);
}
.item-tip .tip-stat.pos b {
  color: #7ed3a6;
}
.item-tip .tip-stat.neg b {
  color: #ff6b6b;
}
.item-tip .tip-stat.tot {
  border-top: 2px solid #435775;
  font-weight: 700;
}
.stat[data-tip] {
  cursor: help;
}

.cb-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}
.cb-tab {
  background: #16233a;
  color: #e8edf8;
  border: 1px solid #435775;
  border-radius: 8px 8px 0 0;
  padding: 8px 14px;
  cursor: pointer;
  font: inherit;
}
.cb-tab small {
  opacity: 0.7;
  margin-left: 4px;
}
.cb-tab.active {
  background: #2a4a7a;
  border-color: #7aa7e6;
  font-weight: 700;
}
.cb-tab.add {
  border-style: dashed;
  background: transparent;
}
.cb-res {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0;
}
.cb-buff[data-tip] {
  cursor: help;
}

.nav-group {
  margin: 6px 0;
}
.nav-group[hidden] {
  display: none;
}
.nav-gtitle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8fa3c4;
  cursor: pointer;
  user-select: none;
  border-radius: 8px;
}
.nav-gtitle:hover {
  color: #e8edf8;
  background: #ffffff0d;
}
.nav-group.collapsed .nav-items {
  display: none;
}
.nav-gname {
  flex: 1;
}
.nav-gdel {
  display: none;
  background: none;
  border: 0;
  color: #ff6b6b;
  cursor: pointer;
}
body.ui-edit .nav-gdel {
  display: inline-block;
}
body.ui-edit .nav-gtitle {
  cursor: grab;
  outline: 1px dashed #5a78a8;
}
body.ui-edit .nav-items button[data-page] {
  cursor: grab;
  outline: 1px dashed #3f5880;
  margin-top: 2px;
}
body.ui-edit .nav-items {
  min-height: 26px;
}
#uiEditToggle {
  width: 100%;
  text-align: left;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px dashed #c9a24d;
  background: transparent;
  color: #e7c46f;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
}
#uiEditToggle.on {
  background: #c9a24d;
  color: #1b1405;
}
#uiEditToggle[hidden] {
  display: none;
}
.ui-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
  padding: 8px;
  border: 1px solid #c9a24d;
  border-radius: 10px;
  background: #1a1608;
}
.ui-toolbar small {
  flex-basis: 100%;
  color: #e7c46f;
}
.ui-toolbar button {
  background: #2a2412;
  color: #e7c46f;
  border: 1px solid #6b5822;
  border-radius: 8px;
  padding: 5px 8px;
  cursor: pointer;
}
.ui-inline {
  padding: 2px 6px;
  width: 100%;
}
body.ui-edit main h1,
body.ui-edit main h2,
body.ui-edit main h3,
body.ui-edit main p,
body.ui-edit main .hint,
body.ui-edit main label,
body.ui-edit main small {
  outline: 1px dotted #c9a24d55;
}
#nav .nav-gdel {
  display: none !important;
}
body.ui-edit #nav .nav-gdel {
  display: inline-flex !important;
  width: auto;
  padding: 0 6px;
  background: none;
  border: 0;
  color: #ff6b6b;
}
.ui-dragging {
  opacity: 0.35;
}
#nav .drop-before {
  box-shadow:
    0 -3px 0 0 #ffd36b,
    0 -6px 10px -2px #ffd36b88;
}
#nav .drop-after {
  box-shadow:
    0 3px 0 0 #ffd36b,
    0 6px 10px -2px #ffd36b88;
}
#nav .nav-items.drop-end {
  background: #ffd36b22;
  outline: 2px dashed #ffd36b;
  outline-offset: -2px;
  border-radius: 8px;
}
body.ui-edit .ui-hover {
  outline: 1px dashed #ffd36b;
  outline-offset: 2px;
  cursor: text;
}
#uiBanner {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  gap: 12px;
  align-items: center;
  max-width: 94vw;
  background: #1a1608;
  border: 1px solid #c9a24d;
  color: #e7c46f;
  border-radius: 12px;
  padding: 8px 14px;
  box-shadow: 0 6px 24px #000a;
  font-size: 13px;
}
#uiBanner button {
  background: #c9a24d;
  color: #1b1405;
  border: 0;
  border-radius: 8px;
  padding: 5px 12px;
  cursor: pointer;
  font-weight: 600;
}
textarea.ui-inline {
  font: inherit;
}

.echo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.echo-card h3 {
  margin: 0;
}
.echo-off {
  opacity: 0.55;
}
.echo-fx {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.echo-chip {
  display: inline-block;
  border: 1px solid #3b4d64;
  background: #172338;
  border-radius: 14px;
  padding: 3px 10px;
  font-size: 12px;
}
.echo-chip.pos {
  color: #7ed3a6;
  border-color: #2f5a49;
}
.echo-chip.neg {
  color: #ff8a8a;
  border-color: #6a3a3a;
}
.echo-line {
  border-top: 1px solid #26354a;
  padding: 8px 0;
}
.echo-line:first-of-type {
  border-top: 0;
}
#echoBox {
  margin-bottom: 12px;
}
#echoBox.hidden {
  display: none;
}

#chestFloat {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 45;
  background: #111b2b;
  border: 1px solid #3b4d64;
  border-radius: 12px;
  padding: 10px 12px;
  max-width: 320px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}
#chestFloat.hidden {
  display: none;
}
.cf-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.cf-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cf-chest {
  background: #172338;
  border: 1px solid #485d77;
  border-radius: 10px;
  padding: 6px 10px;
  color: #dfc38d;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
}
.cf-chest:hover {
  border-color: #dfc38d;
}
.cf-chest.done {
  opacity: 0.55;
}
.cf-icon {
  font-size: 28px;
  line-height: 1.1;
}
.cf-chest small {
  font-size: 11px;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.loot-res {
  margin: 6px 0;
  padding-left: 20px;
}
.loot-res li {
  margin: 2px 0;
}
#cbLootPanel.hidden {
  display: none;
}

.bulk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2px 12px;
}
.lore-text {
  white-space: pre-wrap;
  line-height: 1.5;
}
.lore-appear {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.lore-portrait {
  width: 150px;
  max-height: 220px;
  object-fit: contain;
  background: #101a29;
  border-radius: 10px;
  cursor: zoom-in;
}
.lore-appear > div {
  flex: 1;
  min-width: 200px;
}
.lore-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.lore-gallery figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 140px;
}
.lore-gallery img {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border-radius: 8px;
  cursor: zoom-in;
  background: #101a29;
}
.lore-gallery figcaption {
  font-size: 12px;
  color: #b9c8db;
}
.lore-body {
  max-height: 65vh;
  overflow: auto;
  padding-right: 4px;
}
.lore-rolls {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 6px 0;
}
.die {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-weight: 700;
  border: 1px solid #3b506b;
}
.die.ok {
  background: #1f5c3a;
  color: #bff5d3;
}
.die.ko {
  background: #4a2530;
  color: #f5c0c8;
}
.lrn-row {
  margin: 8px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #2a3b52;
}
.lrn-slider {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 220px;
}
.lrn-slider input {
  flex: 1;
}
#miniBag {
  grid-auto-rows: 56px;
  max-height: 184px;
  overflow-y: auto;
  padding-right: 4px;
}
#miniBag .item {
  aspect-ratio: auto;
  min-height: 0;
  height: 56px;
}
.rp-total {
  font-size: 20px;
  color: #e9c987;
}

.cb-icon[data-cb-img] {
  cursor: zoom-in;
}
.cb-icon[data-cb-img] img {
  transition: transform 0.15s;
}
.cb-icon[data-cb-img]:hover img {
  transform: scale(1.08);
}
.cb-name[data-cb-sheet] {
  cursor: pointer;
}
.cb-name[data-cb-sheet]:hover {
  text-decoration: underline;
  color: #dfc38d;
}

.rc-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.rc-tools .input {
  flex: 1 1 160px;
  min-width: 140px;
}
.rc-group {
  border: 1px solid #26354a;
  border-radius: 8px;
  margin: 6px 0;
  padding: 4px 10px;
  background: #0e1828;
}
.rc-group summary {
  cursor: pointer;
  font-weight: 600;
  padding: 4px 0;
}
.rc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 5px 0;
}
.rc-row span {
  flex: 1;
}
.surv-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}
.surv-tag {
  border-color: #6b8f6f;
}
.surv-tag.used {
  border-color: #c85a5a;
  color: #ffb3b3;
}
.surv-tag.ok {
  color: #a8e6b4;
}

#playerList {
  overflow-y: auto;
  max-height: 610px;
  padding-right: 6px;
}

#chestFloat .cf-head,
#rpFloat .cf-head {
  cursor: grab;
  user-select: none;
  touch-action: none;
}
#chestFloat.moving .cf-head,
#rpFloat.moving .cf-head {
  cursor: grabbing;
}
#rpFloat {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 45;
  background: #111b2b;
  border: 1px solid #3b4d64;
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 230px;
  max-width: 320px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}
#rpFloat.hidden {
  display: none;
}
#rpFloat .rpf-list .detail-stat {
  padding: 4px 0;
}

.item-tip {
  overflow-wrap: anywhere;
}
.item-tip .tip-stat b {
  white-space: normal;
  text-align: right;
}
.item-tip .tip-meta {
  white-space: normal;
}

.craft-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.craft-filters .input {
  flex: 1 1 220px;
}
.craft-cat {
  grid-column: 1/-1;
  margin: 14px 0 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line, #444);
}
.currency .coin {
  margin-right: 8px;
  white-space: nowrap;
}
.currency {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
}
.stat.drunk b {
  color: #f0a0a0;
}
.stat .tinybutton {
  margin-left: 8px;
}
.pick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 140px;
  overflow: auto;
  margin-top: 6px;
}
#drunkBox {
  margin-top: 16px;
}

/* icônes d'objets uploadées : toujours contenues et centrées dans leur cadre */
.producticon,
.enchant-choice-icon,
.rarity-frame,
.item,
.slot {
  overflow: hidden;
  box-sizing: border-box;
  position: relative;
}
.producticon,
.enchant-choice-icon {
  padding: 0;
}
.producticon .imgtiny,
.enchant-choice-icon .imgtiny,
.rarity-frame .imgtiny,
.item .imgtiny,
.slot .imgtiny {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 0;
  padding: 3px;
  box-sizing: border-box;
}
/* emplacements d'équipement : l'image prend la place de l'emoji, le nom reste en dessous */
.slot .imgtiny {
  position: static;
  inset: auto;
  width: 46px;
  height: 46px;
  flex: none;
  padding: 0;
}

/* ===== Lore du monde ===== */
.wcols {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 800px) {
  .wcols {
    grid-template-columns: 1fr;
  }
}
.wleft .actions {
  margin-bottom: 8px;
  flex-wrap: nowrap;
}
.wtree {
  max-height: 60vh;
  overflow: auto;
  border: 1px solid #26354a;
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 10px;
}
.wnode {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: inherit;
  padding: 6px 8px;
  cursor: pointer;
  font: inherit;
}
.wnode:hover {
  background: #17263b;
}
.wnode.active {
  background: #263045;
  outline: 1px solid #a58852;
}
.wtype {
  font-size: 11px;
  color: #d9bd7c;
  border: 1px solid #5b4d2f;
  border-radius: 10px;
  padding: 0 7px;
  margin-right: 4px;
  white-space: nowrap;
}
.wstart {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #b9c8db;
}
.wbread {
  font-size: 12px;
  color: #9fb1c8;
  margin-bottom: 6px;
}
.wbread a {
  color: #9fc7ff;
}
.wdesc {
  line-height: 1.55;
  white-space: normal;
}
.wchips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.wroute {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid #26354a;
  border-radius: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.wgal {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.wgal img {
  max-width: 220px;
  max-height: 170px;
  border-radius: 8px;
  border: 1px solid #41516b;
  object-fit: cover;
  cursor: zoom-in;
  background: #0b101b;
}
.wimgs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.wimg {
  position: relative;
}
.wimg img {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #41516b;
}
.wimg-x {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 0;
  background: #b3382f;
  color: #fff;
  cursor: pointer;
  line-height: 20px;
  padding: 0;
}
.wstatus {
  border-color: #a58852;
}
.wcalhead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 8px;
}
.wgrid {
  display: grid;
  gap: 4px;
}
.wdow {
  font-size: 11px;
  text-align: center;
  color: #9fb1c8;
  overflow: hidden;
  white-space: nowrap;
}
.wday {
  min-height: 44px;
  border: 1px solid #26354a;
  border-radius: 6px;
  padding: 4px 6px;
  position: relative;
  background: #0c1727;
}
.wday.empty {
  border: 0;
  background: transparent;
}
.wday.today {
  border-color: #d9bd7c;
  background: #2a2f40;
}
.wday.ev i {
  position: absolute;
  right: 6px;
  bottom: 2px;
  color: #ff9d6a;
  font-style: normal;
}
.wroute a,
.wbread a,
.wdesc a {
  color: #9fc7ff;
}

/* ===== carte interactive ===== */
.mapbar {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.mapbar label {
  display: grid;
  gap: 3px;
  font-size: 12px;
  color: #b9c8db;
}
.mapedit {
  border: 1px dashed #a58852;
  border-radius: 8px;
  padding: 8px;
}
.mapzoom {
  display: flex;
  gap: 4px;
}
.mapcols {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 14px;
  align-items: start;
}
@media (max-width: 1000px) {
  .mapcols {
    grid-template-columns: 1fr;
  }
}
.mapview {
  position: relative;
  height: 72vh;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid #41516b;
  border-radius: 10px;
  background: #0a1220;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
.mapview.panning {
  cursor: grabbing;
}
.mapview.linking {
  cursor: crosshair;
}
.mapload {
  padding: 20px;
}
.mstage {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.mstage > img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-user-drag: none;
}
.mroutes {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
}
.mroute {
  stroke: #d9bd7c;
  stroke-width: 2.5;
  stroke-dasharray: 8 6;
  vector-effect: non-scaling-stroke;
  opacity: 0.8;
  pointer-events: stroke;
}
.mroute.hot {
  stroke: #6be39a;
  stroke-width: 4;
  stroke-dasharray: none;
  opacity: 1;
}
.mpin {
  position: absolute;
  transform: translate(-50%, -50%) scale(var(--inv, 1));
  transform-origin: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: #fff;
  font: inherit;
}
.mpicon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1b2740;
  border: 2px solid #d9bd7c;
  font-size: 19px;
  box-shadow: 0 2px 8px #000a;
}
.mpname {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  text-shadow:
    0 0 3px #000,
    0 0 3px #000,
    0 1px 4px #000;
  background: #0008;
  border-radius: 6px;
  padding: 0 5px;
}
.mpin:hover .mpicon {
  border-color: #fff;
  background: #2c3b5c;
}
.mpin.sel .mpicon {
  border-color: #6bb7ff;
  box-shadow: 0 0 0 3px #6bb7ff66;
}
.mpin.reach .mpicon {
  border-color: #6be39a;
  box-shadow: 0 0 10px 2px #6be39a99;
}
.mpin.here .mpicon {
  border-color: #ff9d6a;
  animation: mpulse 1.6s infinite;
}
.mpin.mover {
  pointer-events: none;
}
.mpin.mover .mpicon {
  border-color: #ff9d6a;
  background: #3a2a1c;
}
@keyframes mpulse {
  0% {
    box-shadow: 0 0 0 0 #ff9d6aaa;
  }
  70% {
    box-shadow: 0 0 0 14px #ff9d6a00;
  }
  100% {
    box-shadow: 0 0 0 0 #ff9d6a00;
  }
}
.mtip {
  position: absolute;
  z-index: 5;
  max-width: 270px;
  background: #101a2c;
  border: 1px solid #a58852;
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 13px;
  pointer-events: none;
  box-shadow: 0 8px 24px #000b;
}
.mtip img {
  display: block;
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: 6px;
  margin: 6px 0;
}
.mtip p {
  margin: 6px 0;
  color: #c9d6e8;
}
.mtip small {
  color: #9fb1c8;
}
.mtip.hidden {
  display: none;
}
.mhint {
  position: absolute;
  left: 8px;
  bottom: 6px;
  font-size: 11px;
  color: #9fb1c8;
  pointer-events: none;
  text-shadow: 0 0 3px #000;
}
.mapside {
  max-height: 72vh;
  overflow: auto;
}

/* cartes : frontières, textes, poignées */
.mborder .mvit,
.mborder .mvis {
  pointer-events: stroke;
}
.mhit {
  fill: none;
  stroke: transparent;
  stroke-width: 18;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.medit .mhit {
  pointer-events: stroke;
  cursor: pointer;
}
.mvis {
  vector-effect: non-scaling-stroke;
}
.mborder.editing .mvis {
  stroke-opacity: 0.55;
}
.mlabel {
  pointer-events: none;
  user-select: none;
}
.mpin.noname .mpname {
  display: none;
}
.mpin.mhandle .mpicon {
  width: 24px;
  height: 24px;
  font-size: 13px;
  border-color: #6bb7ff;
  background: #14233d;
  opacity: 0.9;
}
.mpin.mvert .mpicon {
  width: 16px;
  height: 16px;
  font-size: 8px;
  border-color: #ffd54a;
  background: #3a3000;
  cursor: move;
}
.mpin.mvert.mid .mpicon {
  width: 14px;
  height: 14px;
  font-size: 11px;
  opacity: 0.7;
  border-style: dashed;
  cursor: copy;
}
.lbprev {
  min-height: 90px;
  display: grid;
  place-items: center;
  background: #0a1220;
  border: 1px solid #41516b;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}
.lbprev span {
  display: inline-block;
  font-size: 28px;
  transform-origin: center;
  white-space: nowrap;
}

/* surface des frontières + calques d'affichage */
.mfill {
  pointer-events: none;
}
.mapview.hide-names .mpname {
  display: none;
}
.mapview.hide-borders .mdeco {
  display: none;
}
.mapview.hide-labels .mlabel {
  display: none;
}
.mapview.hide-routes .mroute {
  display: none;
}
.mpin.thidden {
  display: none !important;
}
.mlayers {
  position: relative;
}
.mlayers > summary {
  cursor: pointer;
  list-style: none;
  display: inline-block;
}
.mlayers > summary::-webkit-details-marker {
  display: none;
}
.mlayers-box {
  position: absolute;
  z-index: 20;
  top: 100%;
  left: 0;
  margin-top: 6px;
  min-width: 300px;
  max-width: 92vw;
  max-height: 60vh;
  overflow: auto;
  background: #101a2c;
  border: 1px solid #a58852;
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 18px;
  box-shadow: 0 10px 30px #000b;
}
.mlayers-box .actions {
  grid-column: 1/-1;
}
.mlayers-col {
  display: grid;
  gap: 2px;
  align-content: start;
}
@media (max-width: 600px) {
  .mlayers-box {
    grid-template-columns: 1fr;
  }
}
.mapbar .mlayers-box label.stat-toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.mlayers-box input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex: none;
}

/* zones cachées (visibles du staff seulement) */
.mmask .mvis {
  fill: #9b59b6;
  fill-opacity: 0.22;
  stroke: #d7a8ee;
  stroke-width: 2;
  stroke-dasharray: 8 5;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.mmask .mhit {
  fill: none;
  stroke: transparent;
  stroke-width: 14;
  vector-effect: non-scaling-stroke;
  pointer-events: stroke;
}

/* zones des frontières survolables, trajectoires de routes, mode verrouillé */
.mzone {
  fill: transparent;
  stroke: none;
  pointer-events: all;
}
.mapview.locked .mzone {
  pointer-events: none;
}
.mroutegrp .mroute {
  fill: none;
}
.mroute.editing,
.mmask.editing .mvis {
  stroke: #ffd54a;
}
.mapview.hide-routes .mroutegrp {
  display: none;
}
.mapview.locked .mborder *,
.mapview.locked .mmask *,
.mapview.locked .mroutegrp * {
  pointer-events: none !important;
}

/* routes : cachées, visibles au survol d'une route (ou d'un lieu) accessible depuis ma position */
.mroutegrp .mroute {
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.mroutegrp.show .mroute {
  opacity: 1;
}
.mroutegrp .mroute.active {
  opacity: 0.6;
}
.mapview.medit .mroutegrp .mroute {
  opacity: 0.8;
}
.mapview.medit .mroutegrp .mroute.editing {
  opacity: 1;
}
/* jetons de voyage */
.mpin.mover {
  transition:
    left 1s linear,
    top 1s linear;
}
.mpin.mover .mpicon {
  width: 30px;
  height: 30px;
  overflow: hidden;
  padding: 0;
}
.mpin.mover .mpicon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.mpin.mover.own .mpicon {
  border-color: #ffd54a;
  box-shadow:
    0 0 0 3px #ffd54a55,
    0 2px 8px #000a;
}
.mpin.mover:not(.own) .mpicon {
  border-color: #9ec5ff;
}

.mtip .wzm,
.mtip small.wzm {
  display: block;
  margin-top: 3px;
  opacity: 0.9;
}
.mapview.medit .mroutegrp .mroute,
.mapview.medit .mroutegrp .mhit {
  pointer-events: stroke;
}

.mltz {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin: 3px 0;
}
.mltz .input {
  width: 64px;
  padding: 3px 6px;
}

.wpal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin: -2px 0 8px;
}
.wpal-t {
  font-size: 11px;
  color: #d9bd7c;
  margin-right: 4px;
}
.wsw {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ffffff55;
  cursor: pointer;
  padding: 0;
}
.wsw:hover {
  border-color: #fff;
}
.wsw.del {
  outline: 2px dashed #e74c3c;
  outline-offset: 1px;
}
.wpal .on {
  background: #7a2b2b;
}
.wgroup {
  font-size: 12px;
  color: #d9bd7c;
  opacity: 0.95;
}

.wctx {
  position: fixed;
  z-index: 9999;
  background: #101a2c;
  border: 1px solid #a58852;
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 6px 20px #000a;
}
.wctx button {
  background: transparent;
  border: 0;
  color: #f5d7d7;
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
  border-radius: 6px;
}
.wctx button:hover {
  background: #3a1f1f;
}
.wcont {
  margin: 6px 0;
}
.wcont > b {
  font-size: 12px;
  color: #d9bd7c;
}

.mapview.hide-conts .mconts {
  display: none;
}
.mapview.hide-zones .mzones {
  display: none;
}
.mpin.mover {
  pointer-events: auto;
  cursor: help;
}
.mpin.mover .mpname {
  pointer-events: none;
}

.mtip.mtipfix {
  box-sizing: border-box;
  position: fixed;
  z-index: 9998;
  pointer-events: none;
}

.wcontinent {
  margin: 8px 0;
  border-left: 2px solid #a58852;
  padding-left: 8px;
}
.wcontinent > .wcbtn {
  width: 100%;
  text-align: left;
  margin-bottom: 2px;
}
.wcnest {
  margin-left: 4px;
}

.wcgrp {
  background: transparent;
  border: 0;
  color: #d9bd7c;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 0;
  text-align: left;
}
.wcgrp:hover {
  color: #fff;
}

.wcrow {
  display: flex;
  align-items: center;
  gap: 4px;
}
.wcrow .wcbtn {
  flex: 1;
}
.wcgrp.wctog {
  padding: 2px 6px;
}
.wtmove {
  margin-left: auto;
  display: inline-flex;
  gap: 2px;
}
.wtm {
  background: #1b2740;
  border: 1px solid #5b4d2f;
  color: #d9bd7c;
  border-radius: 5px;
  font-size: 10px;
  line-height: 1;
  padding: 3px 5px;
  cursor: pointer;
}
.wtm:disabled {
  opacity: 0.3;
  cursor: default;
}
.wtm:hover:not(:disabled) {
  background: #2c3b5c;
  color: #fff;
}

/* Catalogue des objets : liste par catégorie, 5 lignes visibles puis défilement */
.adminlist {
  max-height: 210px;
  overflow-y: auto;
  border: 1px solid #3a4a68;
  border-radius: 10px;
  padding: 4px;
  margin: 10px 0;
  background: #0e1626;
}
.alhead {
  display: block;
  width: 100%;
  text-align: left;
  background: #16223a;
  border: 0;
  border-radius: 7px;
  color: #d9bd7c;
  font: inherit;
  font-weight: 700;
  padding: 6px 8px;
  margin-top: 3px;
  cursor: pointer;
}
.alhead:hover {
  background: #1f2f50;
}
.alrow {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: inherit;
  font: inherit;
  padding: 6px 8px 6px 22px;
  cursor: pointer;
}
.alrow:hover {
  background: #1b2740;
}
.alrow.active {
  background: #2c3b5c;
  color: #fff;
}
.alempty {
  margin: 2px 0 4px 22px;
}
.adminsel-ghost {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 2px;
  height: 2px;
  overflow: hidden;
}

.craft-cat-btn,
.pickhead {
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 0;
  text-align: left;
}
.craft-cat-btn:hover {
  color: #fff;
}
.pickhead {
  display: block;
  width: 100%;
  color: #d9bd7c;
  padding: 5px 2px;
  margin-top: 2px;
}
.pickhead:hover {
  color: #fff;
}
#craftPickList {
  max-height: 246px;
}

.bagmultibar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid #6b3a3a;
  border-radius: 8px;
  background: rgba(120, 40, 40, 0.15);
}
.bagmultibar span {
  margin-right: auto;
  font-weight: 700;
}
.item.bagsel {
  outline: 2px solid #d46a6a;
  background: rgba(212, 106, 106, 0.18);
}
.bagmultibar.hidden {
  display: none;
}

.onlinebox {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #7fd48a;
}
.onlinebox.hidden {
  display: none;
}

/* ===== Lot 3 : systèmes de vie (entraînement, taverne, auberge, loto, métiers, bâtiments, écurie, académie) ===== */
.rolepicker.hidden {
  display: none;
}
.rolepicker.viewing {
  border-color: #d6b16b;
  box-shadow: 0 0 0 1px #d6b16b66;
}
.sys-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.sys-chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid #3a4f6b;
  background: #14233a;
  color: #cfdcf0;
  font-size: 12px;
  white-space: nowrap;
}
.sys-chip.warn {
  border-color: #b5544a;
  color: #ffb4a8;
  background: #3a1d1d;
}
.sys-form {
  display: grid;
  gap: 10px;
  margin: 10px 0;
}
.sys-form label {
  display: grid;
  gap: 4px;
  color: #afc1d7;
  font-size: 12px;
}
.sys-form small.muted {
  color: #8da0bb;
}
.sys-dur {
  display: grid;
  grid-template-columns: 1fr repeat(3, minmax(70px, 110px));
  gap: 8px;
  align-items: end;
  color: #afc1d7;
  font-size: 12px;
}
.sys-dur > span {
  align-self: center;
}
.sys-dur label {
  display: grid;
  gap: 4px;
}
.sys-until {
  color: #e8d2a4;
  font-variant-numeric: tabular-nums;
}
.loto-pot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
  padding: 12px 16px;
  border: 1px solid #d6b16b;
  border-radius: 10px;
  background: linear-gradient(135deg, #2a2210, #1a1409);
  color: #e8d2a4;
}
.loto-pot strong {
  font-size: 20px;
}
.loto-ticket {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
  padding: 10px;
  border: 2px dashed #8a7a4d;
  border-radius: 10px;
  background: #1c1a12;
}
.loto-num {
  display: inline-block;
  min-width: 52px;
  padding: 4px 8px;
  text-align: center;
  border-radius: 6px;
  border: 1px solid #3a4f6b;
  background: #14233a;
  color: #cfdcf0;
  font-variant-numeric: tabular-nums;
}
.loto-num.win {
  border-color: #d6b16b;
  background: #3a2f12;
  color: #ffd979;
  font-weight: 700;
}
#gunPanel .detail-stat strong {
  display: flex;
  align-items: center;
  gap: 8px;
}
#cbGunBox .detail-stat {
  gap: 10px;
}

/* Infobulle : points exacts donnés par un passif en pourcentage */
.item-tip .tip-sub {
  margin: -2px 0 3px;
  text-align: right;
  font-size: 0.78em;
  opacity: 0.75;
}

/* Sexe des chevaux : bleu pour un mâle, rose pour une femelle */
.sex-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5em;
  height: 1.5em;
  padding: 0 0.25em;
  border-radius: 999px;
  font-size: 1.15em;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
}
.sex-badge.sex-m {
  color: #cfe6ff;
  background: #2a6fdb;
  box-shadow: 0 0 0 2px rgba(77, 163, 255, 0.35);
}
.sex-badge.sex-f {
  color: #ffe0ef;
  background: #d9468f;
  box-shadow: 0 0 0 2px rgba(255, 111, 177, 0.35);
}

/* Ville d'un bâtiment, ajoutée à son nom dans le menu */
.wtown {
  font-size: 0.82em;
  opacity: 0.8;
  font-weight: 500;
}

/* Livres de la bibliothèque : passages à retenir */
.book-text {
  white-space: pre-wrap;
  line-height: 1.6;
  max-height: 60vh;
  overflow-y: auto;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}
.book-find {
  cursor: pointer;
  color: inherit;
  background: rgba(255, 214, 102, 0.22);
  border-bottom: 2px dashed #ffd666;
  border-radius: 3px;
  padding: 0 2px;
}
.book-find:hover {
  background: rgba(255, 214, 102, 0.4);
}
.book-find.got {
  background: rgba(100, 200, 120, 0.2);
  border-bottom: 2px solid #64c878;
  cursor: default;
}

/* Titre d'un cheval : signe du sexe, nom et race sur une ligne */
.horse-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.horse-title .sex-badge {
  flex: none;
}

/* compteur de chevaux de l'écurie */
.sys-chip.full {
  border-color: #c0392b;
  color: #ff8d7f;
}

/* arbre généalogique d'un cheval */
.fam h3 {
  margin: 14px 0 6px;
}
.fam-node {
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  margin: 4px 0;
  background: rgba(255, 255, 255, 0.04);
}
.fam-node.unknown {
  opacity: 0.55;
  font-style: italic;
}
.fam-stats,
.fam-muts {
  font-size: 0.85em;
  opacity: 0.85;
}
.fam-tree,
.fam-tree ul {
  list-style: none;
  margin: 0;
  padding-left: 18px;
  border-left: 2px solid rgba(217, 189, 124, 0.35);
}
.fam-tree {
  padding-left: 0;
  border-left: none;
}
.fam-tree li {
  margin: 4px 0;
}

/* infobulle d'une zone de voyage */
.ztip-list {
  margin: 2px 0 4px;
  padding-left: 16px;
  font-size: 0.9em;
}
.ztip-ev {
  margin: 4px 0 2px;
}

/* mode maintenance */
.maint-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #0b1018;
}
.maint-card {
  max-width: 460px;
  text-align: center;
  padding: 32px 28px;
  border: 1px solid rgba(217, 189, 124, 0.45);
  border-radius: 14px;
  background: #121a27;
}
.maint-icon {
  font-size: 48px;
}
.maint-card h1 {
  margin: 8px 0 12px;
  font-size: 1.6rem;
}
.maint-card p {
  margin: 0 0 18px;
  white-space: pre-line;
}
.maint-band {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  padding: 6px 12px;
  text-align: center;
  font-size: 0.85rem;
  background: #7a2d00;
  color: #ffe8c9;
}

/* Infobulle : une ligne « empilée » met le nom au-dessus de la valeur (les noms longs passent à la ligne) */
.item-tip .tip-stat span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.item-tip .tip-stat.stack {
  flex-direction: column;
  gap: 1px;
}
.item-tip .tip-stat.stack span {
  font-weight: 700;
}
.item-tip .tip-stat.stack b {
  text-align: left;
  font-weight: 400;
  color: #7ed3a6;
}

/* Pastille qui peut passer à la ligne (liste de mutations aux noms longs) */
.sys-chip.wrap {
  white-space: normal;
  border-radius: 12px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
