/* CandeaSMP Squaremap: modern, map-first interface */

:root {
  color-scheme: dark;
  --csm-bg: #151b23;
  --csm-panel: rgba(22, 29, 39, .94);
  --csm-panel-solid: #1b2430;
  --csm-panel-hover: #293646;
  --csm-border: rgba(184, 202, 222, .14);
  --csm-border-strong: rgba(184, 202, 222, .24);
  --csm-text: #edf3fa;
  --csm-muted: #9eacbd;
  --csm-accent: #6abcf0;
  --csm-accent-soft: rgba(106, 188, 240, .16);
  --csm-shadow: 0 8px 24px rgba(0, 0, 0, .24);
  --csm-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Keep map tiles and their colors unchanged. */
html, body, #map {
  width: 100%;
  height: 100%;
  margin: 0;
  font-family: var(--csm-font);
  font-size: 13px;
}

body {
  overflow: hidden;
  background: #10151c;
}

#map {
  height: 100dvh;
  background: #10151c;
  color: var(--csm-text);
}

.leaflet-container {
  font-family: var(--csm-font);
  font-size: 12px;
  outline: none;
}

/* Floating map controls: understated, consistent, and easy to use. */
.leaflet-container .leaflet-bar,
.leaflet-touch .leaflet-bar,
.leaflet-container .leaflet-control-layers,
.leaflet-touch .leaflet-control-layers {
  overflow: hidden;
  color: var(--csm-text);
  background: var(--csm-panel);
  border: 1px solid var(--csm-border);
  border-radius: 10px;
  box-shadow: var(--csm-shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.leaflet-bar a,
.leaflet-touch .leaflet-bar a {
  display: block;
  width: 34px;
  height: 34px;
  line-height: 32px;
  color: var(--csm-text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--csm-border);
  border-radius: 0;
  font-family: var(--csm-font);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}

.leaflet-bar a:last-child { border-bottom: 0; }
.leaflet-bar a:hover,
.leaflet-bar a:focus-visible {
  color: #fff;
  background: var(--csm-panel-hover);
  outline: none;
}
.leaflet-bar a.leaflet-disabled {
  color: #657181;
  background: rgba(16, 21, 28, .5);
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
  font: 500 21px/32px var(--csm-font);
}

.leaflet-control-layers-expanded {
  padding: 9px 12px;
  background: var(--csm-panel);
  color: var(--csm-text);
}
.leaflet-control-layers label {
  font-size: 12px;
  line-height: 1.8;
}
.leaflet-control-layers-separator {
  border-top: 1px solid var(--csm-border);
}
.leaflet-control-layers-selector {
  accent-color: var(--csm-accent);
}

.leaflet-top .leaflet-control { margin-top: 14px; }
.leaflet-bottom .leaflet-control { margin-bottom: 14px; }
.leaflet-left .leaflet-control { margin-left: 14px; }
.leaflet-right .leaflet-control { margin-right: 14px; }

.leaflet-container .leaflet-control-attribution {
  margin: 0 5px 5px 0;
  padding: 4px 7px;
  color: #c5d0dd;
  background: rgba(18, 24, 32, .8);
  border: 1px solid rgba(184, 202, 222, .1);
  border-radius: 6px;
  font-family: var(--csm-font);
  font-size: 10px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.leaflet-control-attribution a {
  color: var(--csm-accent);
}

/* Sidebar uses a single surface with subtle separators instead of stacked cards. */
#sidebar {
  z-index: 10000;
  top: 12px;
  right: 12px;
  box-sizing: border-box;
  width: 0;
  height: calc(100dvh - 24px);
  padding-left: 10px;
  overflow: hidden;
  color: var(--csm-text);
  background: var(--csm-panel);
  border: 1px solid transparent;
  border-radius: 14px;
  box-shadow: none;
  font: 12px/1.5 var(--csm-font);
  text-align: right;
  display: flex;
  flex-flow: column;
  transition: width .22s ease, padding .22s ease, border-color .22s ease, box-shadow .22s ease;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

#sidebar.show {
  width: 268px;
  padding-left: 0;
  border-color: var(--csm-border);
  box-shadow: var(--csm-shadow);
}

#sidebar legend {
  display: block;
  margin: 10px 12px 8px;
  color: var(--csm-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  line-height: 1.4;
  text-transform: uppercase;
}

#sidebar fieldset {
  clear: right;
  min-width: 0;
  margin: 12px 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--csm-border);
  text-align: left;
  white-space: nowrap;
  transition: margin .22s ease;
}

#sidebar fieldset#worlds {
  margin: 0;
  padding-top: 4px;
}

#sidebar fieldset#players {
  flex: 1 1 auto;
  margin: 8px 0 0;
  padding-bottom: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #52657a transparent;
}

#sidebar fieldset#players::-webkit-scrollbar { width: 6px; }
#sidebar fieldset#players::-webkit-scrollbar-track { background: transparent; }
#sidebar fieldset#players::-webkit-scrollbar-thumb {
  background: #52657a;
  border-radius: 6px;
}
#sidebar fieldset#players::-webkit-scrollbar-thumb:hover {
  background: #728ba4;
}

#sidebar fieldset a,
#sidebar fieldset a:visited {
  display: block;
  box-sizing: border-box;
  margin: 2px 7px;
  padding: 8px 10px;
  overflow: hidden;
  color: #dce6f1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}

#sidebar fieldset#players a {
  padding: 7px 10px;
}

#sidebar fieldset a:hover,
#sidebar fieldset a:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, .06);
  border-color: rgba(184, 202, 222, .08);
  outline: none;
}

#sidebar fieldset a.following {
  color: #fff;
  background: var(--csm-accent-soft);
  border-color: rgba(106, 188, 240, .24);
}

#sidebar fieldset a .other-world {
  font-style: italic;
  opacity: .55;
  filter: none !important;
}

#sidebar fieldset a img {
  padding-right: 9px;
  vertical-align: middle;
  image-rendering: pixelated;
  filter: none;
}

#sidebar #pin {
  position: relative;
  right: -160px;
  width: 26px;
  height: 26px;
  margin: 6px 7px 10px;
  padding: 3px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 7px;
  filter: none;
  transition: background-color .15s ease, border-color .15s ease;
}

#sidebar #pin:hover,
#sidebar #pin.pinned:hover,
#sidebar #pin.unpinned:hover {
  background: var(--csm-panel-hover);
  border-color: var(--csm-border-strong);
}

/* Player labels stay legible but don't compete with terrain. */
div.leaflet-nameplate-pane > div {
  margin: 0;
  padding: 3px 6px;
  color: #f5f8fc;
  background: rgba(18, 24, 32, .84);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 5px;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .25);
  font-family: var(--csm-font);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
}

div.leaflet-nameplate-pane div:before {
  border-color: transparent;
}

img.head { display: none !important; }

.leaflet-marker-icon,
.leaflet-marker-shadow,
#sidebar img {
  image-rendering: pixelated;
}

/* Popups and tooltips share the same modern dark surface. */
.leaflet-tooltip,
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  color: var(--csm-text);
  background: var(--csm-panel-solid);
  border: 1px solid var(--csm-border);
  border-radius: 9px;
  box-shadow: var(--csm-shadow);
  font-family: var(--csm-font);
}

.leaflet-tooltip {
  padding: 5px 8px;
  font-size: 12px;
}

.leaflet-popup-content-wrapper { padding: 2px; }
.leaflet-popup-tip { box-shadow: none; }
.leaflet-container a.leaflet-popup-close-button {
  color: var(--csm-muted);
}
.leaflet-container a.leaflet-popup-close-button:hover {
  color: #fff;
}

/* Compact layout for phones and narrow windows. */
@media (max-width: 600px) {
  #sidebar {
    top: 8px;
    right: 8px;
    height: calc(100dvh - 16px);
  }
  #sidebar.show { width: min(248px, 78vw); }
  .leaflet-top .leaflet-control { margin-top: 10px; }
  .leaflet-bottom .leaflet-control { margin-bottom: 10px; }
  .leaflet-left .leaflet-control { margin-left: 10px; }
  .leaflet-right .leaflet-control { margin-right: 10px; }
  .leaflet-bar a,
  .leaflet-touch .leaflet-bar a {
    width: 32px;
    height: 32px;
    line-height: 30px;
  }
  .leaflet-container .leaflet-control-attribution { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  #sidebar,
  #sidebar fieldset,
  #sidebar fieldset a,
  .leaflet-bar a {
    transition: none;
  }
}


/* CandeaSMP: premium sidebar and icon pass */
:root {
  --csm-panel: rgba(17, 24, 34, .96);
  --csm-panel-solid: #182230;
  --csm-panel-hover: #26384b;
  --csm-border: rgba(173, 198, 225, .16);
  --csm-border-strong: rgba(173, 198, 225, .3);
  --csm-accent: #76d0ff;
  --csm-accent-soft: rgba(118, 208, 255, .13);
  --csm-shadow: 0 16px 44px rgba(0, 0, 0, .34), 0 2px 8px rgba(0, 0, 0, .18);
}
.leaflet-control-zoom a { position:relative; box-sizing:border-box; font-size:0!important; line-height:0!important; }
.leaflet-control-zoom a::before,.leaflet-control-zoom a.leaflet-control-zoom-in::after { content:"";position:absolute;left:50%;top:50%;width:13px;height:2px;border-radius:2px;background:currentColor;transform:translate(-50%,-50%); }
.leaflet-control-zoom a.leaflet-control-zoom-in::after { transform:translate(-50%,-50%) rotate(90deg); }
.leaflet-control-zoom a:hover { color:var(--csm-accent); }
.leaflet-control-layers-toggle,.leaflet-retina .leaflet-control-layers-toggle,.leaflet-touch .leaflet-control-layers-toggle { position:relative;box-sizing:border-box;width:38px!important;height:38px!important;background-image:none!important;background-color:transparent!important; }
.leaflet-control-layers-toggle::before { content:"";position:absolute;inset:0;background:var(--csm-muted);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3 9 5-9 5-9-5 9-5Z'/%3E%3Cpath d='m3 12 9 5 9-5M3 16l9 5 9-5'/%3E%3C/svg%3E") center/21px 21px no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3 9 5-9 5-9-5 9-5Z'/%3E%3Cpath d='m3 12 9 5 9-5M3 16l9 5 9-5'/%3E%3C/svg%3E") center/21px 21px no-repeat;transition:background-color .15s ease; }
.leaflet-control-layers-toggle:hover::before { background:var(--csm-accent); }
#sidebar { top:14px;right:14px;height:calc(100dvh - 28px);width:0;padding-left:0;background:linear-gradient(180deg,rgba(30,43,59,.98) 0%,rgba(16,23,33,.98) 100%);border:1px solid rgba(190,215,242,.19);border-radius:18px;box-shadow:var(--csm-shadow);text-align:left; }
#sidebar.show { width:310px;padding-left:0; }
#sidebar #pin { position:relative;top:auto;right:auto;align-self:flex-end;flex:0 0 auto;width:34px;height:34px;margin:12px 12px 2px;padding:8px;border:1px solid var(--csm-border);border-radius:10px;background:rgba(255,255,255,.045);filter:none;object-fit:contain; }
#sidebar #pin.pinned,#sidebar #pin.unpinned { opacity:.9; }
#sidebar #pin:hover,#sidebar #pin.pinned:hover,#sidebar #pin.unpinned:hover { background:var(--csm-accent-soft);border-color:rgba(118,208,255,.4); }
#sidebar fieldset { margin:12px 0 0;padding:9px 9px 4px;border-top:1px solid rgba(190,215,242,.12); }
#sidebar fieldset#worlds { margin:0;padding-top:5px;padding-bottom:10px; }
#sidebar legend { display:flex;align-items:center;gap:9px;margin:0 5px 8px;padding:0 5px;color:#b6c7d9;font-size:10px;font-weight:800;letter-spacing:.13em;line-height:1.5;text-transform:uppercase; }
#sidebar legend::before { content:"";display:inline-block;flex:0 0 27px;width:27px;height:27px;border:1px solid rgba(118,208,255,.23);border-radius:8px;background-color:rgba(118,208,255,.09);background-position:center;background-repeat:no-repeat;background-size:15px 15px; }
#sidebar #worlds legend::before { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2376d0ff' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3a15 15 0 0 1 0 18M12 3a15 15 0 0 0 0 18'/%3E%3C/svg%3E"); }
#sidebar #players legend::before { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2376d0ff' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='10' cy='7' r='4'/%3E%3Cpath d='M20 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
#sidebar fieldset#players { flex:1 1 auto;min-height:0;margin-top:5px;padding:12px 8px;border-top-color:rgba(190,215,242,.14); }
#sidebar fieldset a,#sidebar fieldset a:visited { position:relative;display:flex;align-items:center;gap:9px;min-height:38px;margin:3px 0;padding:7px 10px;color:#e0eaf5;background:rgba(255,255,255,.025);border:1px solid transparent;border-radius:10px;font-size:12px;font-weight:550;text-align:left; }
#sidebar fieldset#players a { min-height:40px;padding:7px 10px; }
#sidebar fieldset a img { flex:0 0 auto;width:20px;height:20px;padding-right:0;border-radius:5px;image-rendering:pixelated;filter:drop-shadow(0 1px 2px rgba(0,0,0,.3)); }
#sidebar fieldset a:hover,#sidebar fieldset a:focus-visible { color:#fff;background:rgba(255,255,255,.07);border-color:rgba(190,215,242,.12);outline:none; }
#sidebar fieldset a.following { color:#fff;background:linear-gradient(90deg,rgba(77,176,232,.19),rgba(77,176,232,.055));border-color:rgba(118,208,255,.28);box-shadow:inset 2px 0 0 #76d0ff; }
#sidebar fieldset a .other-world { opacity:.58; }
#sidebar fieldset#players::-webkit-scrollbar-thumb { background:rgba(145,177,207,.35);border-radius:8px; }
#sidebar fieldset#players::-webkit-scrollbar-thumb:hover { background:rgba(145,177,207,.6); }
.leaflet-container .leaflet-bar,.leaflet-container .leaflet-control-layers { border-radius:12px; }
.leaflet-bar a:focus-visible,.leaflet-control-layers-toggle:focus-visible { outline:2px solid var(--csm-accent);outline-offset:2px; }
.leaflet-control-attribution { opacity:.85; }
@media (max-width:600px) { #sidebar{top:8px;right:8px;height:calc(100dvh - 16px)} #sidebar.show{width:min(292px,84vw)} }


/* CandeaSMP: clearer world selection, accessible sidebar, centered coordinates */
#sidebar {
  box-sizing: border-box;
  right: 12px !important;
  width: 44px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(173, 198, 225, .25);
  background: rgba(17, 24, 34, .97);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .32);
  cursor: pointer;
}
#sidebar::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 0;
  width: 42px;
  height: 42px;
  pointer-events: none;
  background: #a9c3dc;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E") center/21px 21px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E") center/21px 21px no-repeat;
}
#sidebar:not(.show) > * {
  opacity: 0;
  pointer-events: none;
}
#sidebar:not(.show):hover {
  border-color: rgba(118, 208, 255, .55);
  background: #1c2938;
}
#sidebar:not(.show):hover::before { background: #76d0ff; }
#sidebar.show {
  width: 310px;
  padding: 0;
  overflow: hidden;
  cursor: default;
}
#sidebar.show::before { display: none; }
#sidebar.show > * {
  opacity: 1;
  pointer-events: auto;
}
#sidebar #pin {
  right: auto !important;
  top: auto;
  align-self: flex-end;
  flex: 0 0 auto;
  margin: 12px 12px 4px;
}

/* World choices use bespoke dimensional glyphs instead of the tiny generic cube PNGs. */
#sidebar #worlds a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 54px;
  margin: 5px 3px;
  padding: 8px 10px;
  border-radius: 11px;
  border: 1px solid rgba(173, 198, 225, .08);
  background: rgba(255, 255, 255, .025);
}
#sidebar #worlds a img { display: none !important; }
#sidebar #worlds a::before {
  content: "";
  display: block;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(173, 198, 225, .17);
  border-radius: 10px;
  background-color: rgba(255, 255, 255, .04);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 24px 24px;
  box-shadow: inset 0 1px rgba(255,255,255,.04);
}
#sidebar #worlds a:has(img[src*="red-cube-smol"])::before {
  background-color: rgba(255, 105, 77, .1);
  border-color: rgba(255, 125, 92, .27);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 3 28 9.5 16 16 4 9.5 16 3Z' fill='%23ff8667' fill-opacity='.95'/%3E%3Cpath d='M4 9.5 16 16v13L4 22.5v-13Z' fill='%23b94737'/%3E%3Cpath d='M28 9.5 16 16v13l12-6.5v-13Z' fill='%23ed654c'/%3E%3Cpath d='M16 3 28 9.5 16 16 4 9.5 16 3Z' fill='none' stroke='%23ffd0b8' stroke-opacity='.9' stroke-width='1'/%3E%3C/svg%3E");
}
#sidebar #worlds a:has(img[src*="purple-cube-smol"])::before {
  background-color: rgba(177, 133, 255, .11);
  border-color: rgba(177, 133, 255, .3);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 3 28 9.5 16 16 4 9.5 16 3Z' fill='%23d4b7ff'/%3E%3Cpath d='M4 9.5 16 16v13L4 22.5v-13Z' fill='%237b55c7'/%3E%3Cpath d='M28 9.5 16 16v13l12-6.5v-13Z' fill='%23a17be8'/%3E%3Cpath d='M16 3 28 9.5 16 16 4 9.5 16 3Z' fill='none' stroke='%23f0e4ff' stroke-width='1'/%3E%3C/svg%3E");
}
#sidebar #worlds a:not(:has(img[src*="red-cube-smol"])):not(:has(img[src*="purple-cube-smol"]))::before {
  background-color: rgba(87, 192, 139, .1);
  border-color: rgba(87, 192, 139, .27);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 3 28 9.5 16 16 4 9.5 16 3Z' fill='%23a5e6b9'/%3E%3Cpath d='M4 9.5 16 16v13L4 22.5v-13Z' fill='%233b9b68'/%3E%3Cpath d='M28 9.5 16 16v13l12-6.5v-13Z' fill='%2364c78f'/%3E%3Cpath d='M16 3 28 9.5 16 16 4 9.5 16 3Z' fill='none' stroke='%23dcffe7' stroke-width='1'/%3E%3C/svg%3E");
}
#sidebar #worlds a span {
  min-width: 0;
  overflow: hidden;
  color: #e7f0fa;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .01em;
  text-overflow: ellipsis;
}
#sidebar #worlds a:hover {
  background: rgba(255,255,255,.065);
  border-color: rgba(173,198,225,.18);
}
#sidebar #worlds a.following {
  background: linear-gradient(90deg, rgba(118,208,255,.16), rgba(118,208,255,.045));
  border-color: rgba(118,208,255,.34);
  box-shadow: inset 3px 0 #76d0ff;
}
#sidebar #worlds a.following::before {
  box-shadow: 0 0 0 2px rgba(118,208,255,.07), inset 0 1px rgba(255,255,255,.05);
}

/* Coordinates: prominent, readable, and centered along the lower edge of the map. */
.leaflet-bottom.leaflet-left .coordinates {
  position: absolute !important;
  left: 50vw !important;
  bottom: 18px !important;
  z-index: 1100;
  box-sizing: border-box;
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-width: 208px;
  min-height: 46px;
  padding: 10px 18px !important;
  color: #f0f6ff;
  background: rgba(17, 24, 34, .94);
  border: 1px solid rgba(173, 198, 225, .22);
  border-radius: 13px;
  box-shadow: 0 10px 28px rgba(0,0,0,.32);
  font-family: var(--csm-font);
  font-size: 15px !important;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: .025em;
  line-height: 1.4 !important;
  text-align: center;
  white-space: nowrap;
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.leaflet-bottom.leaflet-left .coordinates::before {
  content: "";
  display: inline-block;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-right: 10px;
  background: #76d0ff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5h18M3 12h18M3 19h18M7 3v4M17 10v4M10 17v4'/%3E%3C/svg%3E") center/16px 16px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5h18M3 12h18M3 19h18M7 3v4M17 10v4M10 17v4'/%3E%3C/svg%3E") center/16px 16px no-repeat;
}
.leaflet-bottom.leaflet-left .coordinates:hover {
  border-color: rgba(118,208,255,.4);
}
@media (max-width: 600px) {
  #sidebar { right: 8px !important; width: 42px; }
  #sidebar.show { width: min(292px, 84vw); }
  #sidebar::before { width: 40px; height: 40px; }
  .leaflet-bottom.leaflet-left .coordinates {
    bottom: 12px !important;
    min-width: 170px;
    min-height: 40px;
    padding: 8px 12px !important;
    font-size: 13px !important;
  }
}

/* CandeaSMP polish: hide pin when collapsed and show actual player skin faces. */
#sidebar:not(.show) #pin { display: none !important; }
#sidebar.show #pin { display: block !important; }
#sidebar #players a img.head {
  display: block !important;
  flex: 0 0 32px;
  width: 32px !important;
  height: 32px !important;
  max-width: 32px;
  max-height: 32px;
  margin: 0;
  padding: 0 !important;
  object-fit: cover;
  image-rendering: pixelated;
  border: 1px solid rgba(173,198,225,.2);
  border-radius: 6px;
  background: #202b38;
  box-shadow: 0 2px 5px rgba(0,0,0,.24);
}
#sidebar fieldset#players a {
  min-height: 48px;
  gap: 11px;
  padding: 7px 10px;
}
#sidebar #players a span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.leaflet-control-layers.link {
  overflow: hidden;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(173,198,225,.22);
  border-radius: 12px;
  background: rgba(17,24,34,.96);
  box-shadow: 0 10px 28px rgba(0,0,0,.3);
}
.leaflet-control-layers.link .leaflet-control-layers-list,
.leaflet-control-layers.link .leaflet-control-layers-toggle { display: none !important; }
.leaflet-control-layers.link a {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 42px;
  height: 42px;
  padding: 9px;
  color: #dfeeff;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}
.leaflet-control-layers.link a:hover {
  color: #fff;
  background: rgba(118,208,255,.15);
}
.leaflet-control-layers.link svg { display: block; width: 24px; height: 24px; }
@media (max-width:600px) {
  #sidebar #players a img.head { flex-basis: 30px; width:30px!important; height:30px!important; }
  .leaflet-control-layers.link, .leaflet-control-layers.link a { width:38px; height:38px; }
}
