.marker {
  width: var(--marker-size, 13px);
  height: var(--marker-size, 13px);
  border-width: var(--marker-border, 2px);
  box-shadow: 0 var(--marker-shadow-y, 2px) var(--marker-shadow-blur, 8px) #000;
  min-width: 0;
  padding: 0;
  appearance: none;
}

.marker em {
  left: var(--label-left, 14px);
  top: var(--label-top, -6px);
  padding: var(--label-pad-y, 3px) var(--label-pad-x, 6px);
  border-radius: var(--label-radius, 5px);
  font-size: var(--label-font, 12px);
}

.event-marker {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  width: var(--event-size, 14px);
  height: var(--event-size, 14px);
  padding: 0;
  border: var(--event-border, 1.5px) solid #fff;
  border-radius: 50%;
  background: #ff9f2f;
  color: #15100a;
  box-shadow: 0 1px 5px #000b;
  font-size: var(--event-font, 10px);
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.event-marker.critical {
  border-radius: 3px;
  background: #ff3348;
  color: white;
  font-size: var(--event-critical-font, 17px);
  box-shadow: 0 0 10px #ff3348aa;
}

.event-marker.warning { background: #ffad42; color: #201305; }
.event-marker.loot-map-marker { z-index: 3; }

.presence {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
}

.presence.online { background: #45db8b; box-shadow: 0 0 7px #45db8b; }
.presence.offline { background: #66788b; }
.server-online { color: #60d69a; }
.server-offline { color: #ff7f87; }

.help select,
.zone-dates input {
  width: 100%;
  padding: 8px;
  border: 1px solid #30445d;
  border-radius: 7px;
  background: #08121f;
  color: white;
}

.help select { margin-bottom: 9px; }
.zone-dates label { margin: 7px 0 4px; }

.zone-row.event-row,
.zone-row.player-zone-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.zone-row.event-row:hover,
.zone-row.player-zone-row:hover { background: #192b40; }
.zone-row.event-row b { color: #ffb45f; }
.results h3 { margin: 18px 0 5px; color: #91a6bc; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.profile-summary { display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #101d2d; }
.profile-summary b { color: #58c6ff; font-size: 18px; }
.profile-summary span { align-self: center; color: #91a6bc; font-size: 12px; }
.results { overflow: hidden; }
.results #zoneRows { max-height: calc(100% - 95px); overflow: auto; padding-right: 3px; }

.map #zone {
  border-width: var(--zone-border, 2px);
}

.map polyline {
  stroke-width: var(--trail-width, 2px);
  vector-effect: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

footer {
  height: 108px;
}

footer button {
  cursor: pointer;
}

.timeline {
  min-width: 0;
}

.timeline-steps {
  display: flex;
  justify-content: center !important;
  gap: 6px;
  margin-bottom: 5px;
}

.timeline-steps button {
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 11px;
  white-space: nowrap;
}

.timeline-steps button:hover {
  background: #203851;
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  color: #8397ad;
  font-size: 12px;
}

.timeline-labels span:first-child {
  color: white;
}

@media (max-width: 760px) {
  .map-area footer {
    height: 112px;
    padding: 0 10px;
    gap: 8px;
  }

  .timeline-steps {
    gap: 3px;
  }

  .timeline-steps button {
    padding: 4px 5px;
    font-size: 10px;
  }
}

.login form input + input {
  margin-top: 10px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge {
  padding: 7px 10px;
  border: 1px solid #2b4058;
  border-radius: 999px;
  background: #111f30;
  color: #b9c9da;
  font-size: 12px;
}

.header-button {
  border: 1px solid #30455e;
  border-radius: 8px;
  background: #14253a;
  color: #e8eef7;
  padding: 8px 10px;
  font-size: 12px;
}

.header-button:hover {
  background: #203851;
}

.loot-button { position: relative; }
.loot-button span {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff3348;
  color: white;
  font-size: 11px;
  font-weight: 900;
}

.loot-panel {
  width: min(1380px, 96vw);
  max-width: none;
  height: min(900px, 94vh);
  padding: 0;
  border: 1px solid #30445d;
  border-radius: 18px;
  background: #0b1624;
  color: #e8eef7;
  box-shadow: 0 30px 90px #000b;
}

.loot-panel::backdrop { background: #02060dd9; backdrop-filter: blur(4px); }
.loot-shell { display: flex; flex-direction: column; height: 100%; padding: 22px; }
.loot-toolbar { display: grid; grid-template-columns: minmax(220px,1fr) 190px 170px 180px auto; gap: 9px; margin: 18px 0 10px; }
.loot-toolbar input,.loot-toolbar select,.loot-toolbar button,.loot-review select,.loot-review textarea,.loot-review button,.loot-detail-actions button {
  border: 1px solid #30445d; border-radius: 8px; background: #101f31; color: #e8eef7; padding: 10px;
}
.loot-toolbar button,.loot-review button,.loot-detail-actions button { cursor: pointer; background: #17304a; }
.loot-stats { display: flex; gap: 9px; margin-bottom: 10px; }
.loot-stat { padding: 7px 10px; border: 1px solid #26394f; border-radius: 999px; color: #9fb2c6; font-size: 12px; }
.loot-stat b { color: white; }
.loot-content { display: grid; grid-template-columns: minmax(370px, .8fr) minmax(480px, 1.2fr); min-height: 0; flex: 1; border: 1px solid #26394f; border-radius: 12px; overflow: hidden; }
.loot-case-rows { overflow: auto; border-right: 1px solid #26394f; background: #0d1928; }
.loot-case-row { width: 100%; padding: 13px 15px; border: 0; border-bottom: 1px solid #203247; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.loot-case-row:hover,.loot-case-row.active { background: #172940; }
.loot-case-row-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.loot-case-row strong { font-size: 14px; }
.loot-case-row p { margin: 6px 0 4px; color: #a9bacb; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loot-case-row small { color: #71879e; }
.severity { width: 9px; height: 9px; flex: none; border-radius: 50%; background: #4d9ed3; box-shadow: 0 0 7px currentColor; }
.severity.warning { color: #ffad42; background: #ffad42; }
.severity.critical { color: #ff4052; background: #ff4052; }
.loot-case-detail { overflow: auto; padding: 20px; background: #0b1624; }
.loot-empty { display: grid; place-items: center; height: 100%; color: #758ba1; text-align: center; }
.loot-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding-bottom: 14px; border-bottom: 1px solid #26394f; }
.loot-detail-head h3 { margin: 3px 0 5px; font-size: 21px; }
.loot-detail-head p { margin: 0; color: #8fa4ba; font-size: 13px; }
.loot-alert { margin: 14px 0; padding: 12px; border: 1px solid #6b2933; border-radius: 9px; background: #351820; color: #ffabb1; font-size: 13px; }
.loot-people { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin: 14px 0; }
.loot-person { padding: 11px; border: 1px solid #26394f; border-radius: 9px; background: #101d2d; }
.loot-person small,.loot-person span { display: block; color: #8197ad; font-size: 11px; }
.loot-person b { display: block; margin: 4px 0; color: white; }
.loot-items { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.loot-items th,.loot-items td { padding: 9px; border-bottom: 1px solid #23364b; text-align: right; }
.loot-items th:first-child,.loot-items td:first-child { text-align: left; }
.loot-items .positive { color: #ffbe62; font-weight: 800; }
.loot-review { display: grid; grid-template-columns: 180px 1fr auto; align-items: stretch; gap: 8px; margin-top: 16px; }
.loot-review textarea { min-height: 70px; resize: vertical; }
.loot-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.loot-detail-actions button.primary { border-color: #26a7ff; background: #26a7ff; color: #031323; font-weight: 800; }
.status-pill { padding: 5px 8px; border-radius: 999px; background: #20344a; color: #b8c9da; font-size: 11px; font-weight: 800; white-space: nowrap; }

@media (max-width: 980px) {
  .loot-toolbar { grid-template-columns: 1fr 1fr; }
  .loot-content { grid-template-columns: 1fr; }
  .loot-case-rows { max-height: 35vh; border-right: 0; border-bottom: 1px solid #26394f; }
  .loot-people { grid-template-columns: 1fr; }
}

.admin-panel {
  width: min(1180px, 94vw);
  max-width: none;
  height: min(820px, 90vh);
  padding: 0;
  border: 1px solid #30445d;
  border-radius: 18px;
  background: #0b1624;
  color: #e8eef7;
  box-shadow: 0 30px 90px #000b;
}

.admin-panel::backdrop {
  background: #02060dcc;
  backdrop-filter: blur(4px);
}

.admin-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px;
}

.admin-heading,
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-heading h2 {
  margin: 2px 0 0;
  font-size: 25px;
}

.admin-kicker {
  color: #6caedc;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid #30445d;
  border-radius: 10px;
  background: #132238;
  color: white;
  font-size: 25px;
}

.admin-tabs {
  display: flex;
  gap: 7px;
  margin: 22px 0 10px;
  border-bottom: 1px solid #26394f;
}

.admin-tabs button {
  padding: 10px 15px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #849ab1;
}

.admin-tabs button.active {
  border-bottom-color: #26a7ff;
  color: white;
}

.admin-message {
  min-height: 20px;
  margin: 0 0 8px;
  color: #60d69a;
  font-size: 13px;
}

.admin-message.error {
  color: #ff7f87;
}

.admin-tab {
  display: none;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.admin-tab.active {
  display: flex;
  flex-direction: column;
}

.create-user {
  display: grid;
  grid-template-columns: 1fr 1.4fr 180px auto;
  align-items: end;
  gap: 12px;
  padding: 15px;
  margin-bottom: 15px;
  border: 1px solid #26394f;
  border-radius: 12px;
  background: #101d2d;
}

.create-user label {
  display: block;
  margin-bottom: 6px;
  color: #91a6bc;
  font-size: 12px;
}

.create-user input,
.create-user select,
.admin-table-wrap select {
  width: 100%;
  padding: 10px;
  border: 1px solid #30445d;
  border-radius: 8px;
  background: #08121f;
  color: white;
}

.create-user button,
.admin-toolbar button,
.row-actions button {
  padding: 10px 12px;
  border: 1px solid #34516f;
  border-radius: 8px;
  background: #17304a;
  color: white;
}

.create-user button {
  border-color: #26a7ff;
  background: #26a7ff;
  color: #031323;
  font-weight: 800;
}

.admin-toolbar {
  margin-bottom: 12px;
}

.admin-toolbar p {
  margin: 0;
  color: #849ab1;
  font-size: 13px;
}

.admin-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid #26394f;
  border-radius: 12px;
}

.admin-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table-wrap th,
.admin-table-wrap td {
  padding: 12px;
  border-bottom: 1px solid #213348;
  text-align: left;
  vertical-align: middle;
}

.admin-table-wrap th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #132238;
  color: #9db0c4;
}

.admin-table-wrap td small {
  display: block;
  margin-top: 4px;
  color: #72879d;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.row-actions button:disabled,
.admin-table-wrap select:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.state {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.state.on {
  background: #123a2a;
  color: #63e3a3;
}

.state.off {
  background: #3b2026;
  color: #ff8a91;
}

@media (max-width: 900px) {
  .user-badge {
    display: none;
  }

  .create-user {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .header-button {
    padding: 7px;
    font-size: 0;
  }

  #adminOpen::after {
    content: 'Admin';
    font-size: 11px;
  }

  #logout::after {
    content: 'Sortir';
    font-size: 11px;
  }

  .admin-shell {
    padding: 15px;
  }

  .create-user {
    grid-template-columns: 1fr;
  }
}
