
/* ShardSMP squaremap custom claims + UI */
:root {
  --sm-bg: rgba(28, 31, 35, 0.92);
  --sm-bg-2: rgba(36, 40, 45, 0.96);
  --sm-bg-3: rgba(22, 25, 28, 0.96);
  --sm-line: rgba(110, 118, 126, 0.45);
  --sm-text: #eceeed;
  --sm-muted: #9aa2aa;
  --sm-green: #67d676;
  --sm-green-dim: #1d2520;
  --sm-shadow: 0 14px 40px rgba(0,0,0,.38), inset 0 1px rgba(255,255,255,.03);
}

.leaflet-container {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
}

.leaflet-bar,
.leaflet-control-layers {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--sm-shadow);
}

.leaflet-bar a,
.leaflet-control-layers-toggle {
  color: var(--sm-text);
  background: var(--sm-bg);
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
}
.leaflet-bar a:hover,
.leaflet-bar a:focus { background: rgba(255,255,255,.12); }
.leaflet-bar a:last-child { border-bottom: none; }

.leaflet-control-scale,
.leaflet-control-attribution {
  background: rgba(20,22,24,.82) !important;
  color: #cfd4d8;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(8px);
}
.leaflet-control-attribution a { color: #e2e7ea; }

/* popup */
.shardsmp-claim-popup,
.shardsmp-claim-hover { color: var(--sm-text); }
.shardsmp-claim-popup {
  width: min(370px, 76vw);
  overflow: hidden;
  background: #202327;
  border: 1px solid #4a4f54;
  box-shadow: var(--sm-shadow);
}
.shardsmp-claim-popup__header {
  display:flex; align-items:center; gap:12px; padding:14px 14px 13px;
  background:#292d31; border-bottom:1px solid #454a4f;
}
.shardsmp-claim-popup__header img {
  width:42px; height:42px; object-fit:contain; image-rendering: pixelated;
  filter: drop-shadow(2px 3px 0 rgba(0,0,0,.35));
}
.shardsmp-claim-popup__header small {
  display:block; margin-bottom:3px; color:#829078; font-size:10px; font-weight:800; letter-spacing:.12em;
}
.shardsmp-claim-popup__header h2 { margin:0; color:#f1f2f2; font-size:18px; line-height:1.15; overflow-wrap:anywhere; }
.shardsmp-claim-popup__header p { margin:3px 0 0; color:#9ba2a8; font-size:11px; }
.shardsmp-claim-popup__value { padding:13px 14px; background:#1d2520; border-bottom:1px solid #3a493d; }
.shardsmp-claim-popup__value span { display:block; color:#84a187; font-size:10px; font-weight:800; letter-spacing:.06em; }
.shardsmp-claim-popup__value strong { display:block; margin-top:3px; color:#6fd37a; font-size:23px; line-height:1.1; }
.shardsmp-claim-popup__stats {
  display:grid; grid-template-columns:1fr 1fr; gap:1px; padding:1px; background:#42474c;
}
.shardsmp-claim-popup__stats > div { min-width:0; padding:10px 11px; background:#292d31; }
.shardsmp-claim-popup__stats .shardsmp-claim-popup__stat-wide { grid-column: 1 / -1; }
.shardsmp-claim-popup__stats .shardsmp-claim-popup__date b {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shardsmp-claim-popup__stats span, .shardsmp-claim-popup__stats b { display:block; }
.shardsmp-claim-popup__stats span { color:#858c93; font-size:10px; }
.shardsmp-claim-popup__stats b { margin-top:3px; color:#e0e2e3; font-size:12px; overflow-wrap:anywhere; }
.shardsmp-claim-popup__progress { padding:11px 13px; background:#25292d; border-top:1px solid #3d4246; }
.shardsmp-claim-popup__progress > div {
  display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:6px; color:#90979d; font-size:10px;
}
.shardsmp-claim-popup__progress b { color:#cfd3d5; font-weight:700; }
.shardsmp-claim-popup__progress > i { display:block; height:8px; overflow:hidden; background:#16191b; border:1px solid #383d41; }
.shardsmp-claim-popup__progress em { display:block; height:100%; background:#59ab52; }

.leaflet-popup-content:has(.shardsmp-claim-popup) { margin:0 !important; width:auto !important; }
.leaflet-popup-content-wrapper:has(.shardsmp-claim-popup) {
  padding:0; overflow:hidden; background:transparent; border-radius:4px;
  box-shadow:none;
}
.shardsmp-claim-hover { display:flex; align-items:baseline; gap:10px; white-space:nowrap; }
.shardsmp-claim-hover b { color:#f0f1f1; font-size:11px; }
.shardsmp-claim-hover span { color:#70cf78; font-size:10px; }

/* custom sidebar / map panels */
#sidebar {
  width:0 !important; padding:0 !important; background:none !important; border:none !important;
  overflow:visible !important; pointer-events:none !important;
}
#sidebar #pin { display:none !important; }
#sidebar > * { pointer-events:auto; }

#shardsmp-map-shell {
  position: fixed; right: 18px; top: 18px; z-index: 11000; display: flex; flex-direction: column; gap: 14px;
  pointer-events: none;
}
#shardsmp-map-shell > * { pointer-events: auto; }
#shardsmp-lieux-toggle {
  display:flex; align-items:center; gap:10px; align-self:flex-end;
  padding: 12px 16px; border-radius: 16px; border:1px solid rgba(255,255,255,.12);
  background: var(--sm-bg); color: var(--sm-text); box-shadow: var(--sm-shadow); backdrop-filter: blur(12px);
  cursor:pointer; font-weight:700; font-size:14px;
}
#shardsmp-lieux-toggle .icon {
  width: 22px; height: 22px; display:grid; place-items:center; background:rgba(255,255,255,.08); border-radius:8px;
}
#shardsmp-lieux-panel,
#shardsmp-players-panel {
  width: 280px; border:1px solid rgba(255,255,255,.12); background: var(--sm-bg-2);
  box-shadow: var(--sm-shadow); backdrop-filter: blur(12px); overflow:hidden;
}
#shardsmp-lieux-panel { display:none; }
body.shardsmp-lieux-open #shardsmp-lieux-panel { display:block; }
#shardsmp-lieux-panel > header,
#shardsmp-players-panel > header {
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding: 12px 14px; background: rgba(255,255,255,.04); border-bottom:1px solid rgba(255,255,255,.08);
  color: var(--sm-text); font-weight:800; letter-spacing:.02em;
}
#shardsmp-lieux-panel > header button {
  border:none; background:rgba(255,255,255,.06); color:#d7dde1; width:28px; height:28px; border-radius:8px; cursor:pointer;
}
#shardsmp-lieux-panel .panel-content,
#shardsmp-players-panel .panel-content {
  max-height: min(62vh, 640px); overflow: auto; padding: 10px;
}
#shardsmp-players-panel { max-height: min(42vh, 420px); }
#shardsmp-players-panel .panel-content { max-height: calc(min(42vh, 420px) - 52px); }
#shardsmp-players-panel .players-count {
  min-width: 28px; height: 28px; display:grid; place-items:center; border-radius:999px;
  background: rgba(103,214,118,.15); color: #82df8e; font-size: 12px;
}
#shardsmp-lieux-panel fieldset,
#shardsmp-players-panel fieldset {
  margin: 0 0 10px; padding: 0; border: 1px solid rgba(255,255,255,.08); background: rgba(0,0,0,.12);
}
#shardsmp-lieux-panel fieldset:last-child,
#shardsmp-players-panel fieldset:last-child { margin-bottom: 0; }
#shardsmp-lieux-panel legend,
#shardsmp-players-panel legend { display:none; }
.shardsmp-section-toggle {
  width:100%; display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding: 11px 12px; border:none; background: rgba(255,255,255,.03); color:#eef0ef; cursor:pointer; font: inherit; font-weight:700;
}
.shardsmp-section-toggle i { font-style:normal; color:#9aa2aa; transition: transform .18s ease; }
fieldset.is-open > .shardsmp-section-toggle i { transform: rotate(180deg); }
.shardsmp-section-body { display:none; padding: 6px 0 8px; }
fieldset.is-open > .shardsmp-section-body { display:block; }
#shardsmp-lieux-panel fieldset a,
#shardsmp-players-panel fieldset a,
#shardsmp-lieux-panel fieldset a:visited,
#shardsmp-players-panel fieldset a:visited {
  display:block; padding: 9px 12px; color: #d8dee2; text-decoration:none; border-radius:10px; margin: 2px 6px;
}
#shardsmp-lieux-panel fieldset a:hover,
#shardsmp-players-panel fieldset a:hover { background: rgba(255,255,255,.08); }
#shardsmp-players-panel fieldset a {
  display:flex; align-items:center; gap:10px;
}
#shardsmp-players-panel fieldset a img,
#shardsmp-lieux-panel fieldset a img { padding-right:0 !important; image-rendering: pixelated; }

@media (max-width: 920px) {
  #shardsmp-map-shell { right: 12px; top: 12px; }
  #shardsmp-lieux-panel,
  #shardsmp-players-panel { width: min(290px, calc(100vw - 24px)); }
}
@media (max-width: 520px) {
  .shardsmp-claim-popup { width: min(332px, 82vw); }
  .shardsmp-claim-popup__stats { grid-template-columns: 1fr; }
  #shardsmp-map-shell { left: 12px; right: 12px; }
  #shardsmp-lieux-toggle { width: 100%; justify-content: center; }
  #shardsmp-lieux-panel,
  #shardsmp-players-panel { width: 100%; }
}


/* v3.3 — claim accent follows Lands' own random land color */
.shardsmp-claim-popup {
  border-color: color-mix(in srgb, var(--claim-border, #67d676) 68%, #4a4f54 32%);
}
.shardsmp-claim-popup__header {
  box-shadow: inset 4px 0 0 var(--claim-accent, #67d676);
}
.shardsmp-claim-popup__header small {
  color: color-mix(in srgb, var(--claim-accent, #67d676) 68%, #b9c1b9 32%);
}
.shardsmp-claim-popup__value {
  background: color-mix(in srgb, var(--claim-accent, #67d676) 11%, #1d2520 89%);
  border-bottom-color: color-mix(in srgb, var(--claim-accent, #67d676) 32%, #3a493d 68%);
}
.shardsmp-claim-popup__value span {
  color: color-mix(in srgb, var(--claim-accent, #67d676) 52%, #b7bdb8 48%);
}
.shardsmp-claim-popup__value strong {
  color: color-mix(in srgb, var(--claim-accent, #67d676) 72%, white 28%);
}
.shardsmp-claim-popup__progress em {
  background: var(--claim-accent, #67d676);
}
.shardsmp-claim-hover span {
  color: color-mix(in srgb, var(--claim-accent, #67d676) 74%, white 26%);
}
