@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;700&display=swap');

:root {
  --ui-bg: rgba(7, 14, 24, 0.82);
  --ui-bg-soft: rgba(20, 31, 48, 0.64);
  --ui-border: rgba(148, 186, 255, 0.26);
  --ui-border-strong: rgba(177, 210, 255, 0.42);
  --ui-text: #e7f1ff;
  --ui-muted: #9bb2d3;
  --ui-accent: #54d29f;
  --ui-accent-2: #58b8ff;
  --ui-shadow: 0 18px 40px rgba(2, 10, 20, 0.45);
}

html,
body {
  font-family: 'Exo 2', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  color: var(--ui-text);
}

.dynmap .sidebar {
  border-left: 1px solid var(--ui-border);
  background: linear-gradient(165deg, rgba(9, 17, 30, 0.94), rgba(9, 16, 27, 0.76));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: -14px 0 34px rgba(4, 10, 20, 0.4);
}

@media screen and (min-width: 640px) {
  .dynmap .sidebar {
    transition-property: margin-right, box-shadow, background-color;
    transition-duration: 0.48s;
    transition-timing-function: cubic-bezier(0.25, 0.9, 0.35, 1);
  }

  .dynmap .hitbar {
    transition-property: right, box-shadow, background-color;
    transition-duration: 0.48s;
    transition-timing-function: cubic-bezier(0.25, 0.9, 0.35, 1);
  }

  .dynmap .sidebar:hover,
  .dynmap .sidebar:hover .hitbar,
  .dynmap .sidebar.pinned,
  .dynmap .sidebar.pinned .hitbar {
    transition-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dynmap .sidebar,
  .dynmap .hitbar {
    transition-duration: 0.01ms !important;
  }
}

.dynmap .sidebar .panel {
  padding-top: 8px;
}

.dynmap .panel legend {
  color: #eaf3ff;
  letter-spacing: 0.04em;
  font-weight: 700;
  font-size: 13px;
}

.dynmap fieldset {
  border-top: 1px solid rgba(140, 174, 232, 0.25);
}

.dynmap .hitbar {
  width: 18px;
  border-color: var(--ui-border);
  background-color: rgba(8, 16, 29, 0.78);
  background-image: none;
}

.dynmap .hitbar::after {
  content: '|||';
  display: block;
  color: rgba(196, 218, 255, 0.72);
  font-size: 16px;
  line-height: 100vh;
  text-align: center;
}

.dynmap .sidebar .panel > .pin {
  border-radius: 8px;
  background-color: rgba(139, 177, 241, 0.1);
  border: 1px solid rgba(184, 209, 247, 0.25);
}

.dynmap .sidebar .panel > .pin:hover {
  box-shadow: 0 0 0 3px rgba(96, 162, 255, 0.14);
}

.dynmap .sublist .item {
  border-radius: 8px;
  background: rgba(32, 51, 79, 0.65);
  border: 1px solid rgba(128, 166, 232, 0.32);
}

.dynmap .sublist .item:hover {
  background: rgba(45, 70, 105, 0.75);
  border-color: rgba(167, 198, 255, 0.45);
}

.dynmap .sublist .item.selected {
  background: linear-gradient(145deg, rgba(84, 210, 159, 0.24), rgba(88, 184, 255, 0.22));
  border-color: rgba(173, 236, 216, 0.7);
}

.dynmap .playerlist .player {
  padding: 7px 6px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.dynmap .playerlist .player:hover {
  background: rgba(53, 85, 126, 0.48);
  border-color: rgba(137, 181, 252, 0.35);
}

.dynmap .playerlist .player.following {
  background: linear-gradient(135deg, rgba(84, 210, 159, 0.24), rgba(88, 184, 255, 0.2));
  border-color: rgba(174, 233, 217, 0.62);
  width: calc(100% - 4px);
}

.dynmap .playerName,
.dynmap .playerNameSm,
.dynmap .playerNameLg,
.dynmap .healthContainer,
.dynmap .healthContainerSm,
.dynmap .healthContainerLg,
.dynmap .mapMarker:hover .markerName,
.dynmap .mapMarker .markerName-show {
  border: 1px solid rgba(165, 201, 255, 0.35);
  background: linear-gradient(135deg, rgba(10, 20, 34, 0.9), rgba(18, 34, 55, 0.88));
  box-shadow: 0 8px 20px rgba(2, 9, 18, 0.45);
}

.leaflet-control-zoom a,
.dynmap .coord-control,
.dynmap .dynmap-link a {
  border-radius: 10px;
  border: 1px solid var(--ui-border);
  background: linear-gradient(165deg, var(--ui-bg), var(--ui-bg-soft));
  color: var(--ui-text);
  box-shadow: var(--ui-shadow);
}

.leaflet-control-zoom {
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--ui-shadow);
  background: transparent;
}

.leaflet-control-zoom a {
  width: 36px;
  height: 36px;
  line-height: 34px;
  font-size: 20px;
  font-weight: 700;
  text-indent: 0;
}

.leaflet-control-zoom a + a {
  border-top: 1px solid rgba(155, 194, 255, 0.26);
}

.leaflet-control-zoom.leaflet-bar {
  box-shadow: var(--ui-shadow);
  border-radius: 12px;
  background: transparent;
}

.leaflet-control-zoom.leaflet-bar a,
.leaflet-control-zoom.leaflet-bar a:hover {
  background-clip: padding-box;
}

.leaflet-control-layers {
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(165deg, rgba(8, 16, 29, 0.9), rgba(14, 27, 43, 0.8));
  box-shadow: var(--ui-shadow);
}

.leaflet-control-layers-toggle {
  border-radius: 10px;
  border: 1px solid var(--ui-border);
  background-image: url(images/layers.png), linear-gradient(165deg, var(--ui-bg), var(--ui-bg-soft));
  background-repeat: no-repeat, no-repeat;
  background-position: center center, center center;
  background-size: 18px 18px, 100% 100%;
  box-shadow: var(--ui-shadow);
}

.leaflet-retina .leaflet-control-layers-toggle {
  background-image: url(images/layers-2x.png), linear-gradient(165deg, var(--ui-bg), var(--ui-bg-soft));
}

.leaflet-touch .leaflet-control-layers-toggle {
  background-size: 20px 20px, 100% 100%;
}

.leaflet-control-layers-expanded {
  padding: 8px;
  color: var(--ui-text);
  min-width: 138px;
}

.leaflet-control-layers-expanded label {
  display: block;
  margin: 3px 0;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}

.leaflet-control-layers-expanded label:hover {
  background: rgba(72, 112, 162, 0.36);
}

.leaflet-control-layers-selector {
  margin-right: 6px;
}

.dynmap .dynmap-link {
  display: none !important;
  border-radius: 12px;
  border: 1px solid var(--ui-border);
  padding: 4px;
  background: linear-gradient(165deg, rgba(8, 16, 29, 0.86), rgba(17, 30, 48, 0.74));
  box-shadow: var(--ui-shadow);
}

.dynmap .dynmap-link a {
  border-radius: 8px;
}

.leaflet-control-zoom a:hover,
.dynmap .dynmap-link a:hover {
  border-color: var(--ui-border-strong);
  background: linear-gradient(165deg, rgba(26, 43, 68, 0.9), rgba(22, 37, 57, 0.8));
}

.leaflet-control-layers-toggle:hover {
  border-color: var(--ui-border-strong);
  background-image: url(images/layers.png), linear-gradient(165deg, rgba(26, 43, 68, 0.9), rgba(22, 37, 57, 0.8));
  background-repeat: no-repeat, no-repeat;
  background-position: center center, center center;
  background-size: 18px 18px, 100% 100%;
}

.leaflet-retina .leaflet-control-layers-toggle:hover {
  background-image: url(images/layers-2x.png), linear-gradient(165deg, rgba(26, 43, 68, 0.9), rgba(22, 37, 57, 0.8));
}

.leaflet-touch .leaflet-control-layers-toggle:hover {
  background-size: 20px 20px, 100% 100%;
}

.dynmap .coord-control {
  color: var(--ui-text);
  min-width: 96px;
  font-size: 12px;
}

.dynmap .coord-control .coord-control-label {
  color: var(--ui-muted);
}

.largeclock {
  width: 200px;
  height: 72px;
  border: 1px solid var(--ui-border);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(180deg, rgba(7, 14, 24, 0.9), rgba(18, 30, 48, 0.82));
  box-shadow: var(--ui-shadow);
}

.digitalclock {
  letter-spacing: 0.05em;
  text-shadow: 0 4px 12px rgba(4, 11, 20, 0.5);
}

.compass,
.compass_NE,
.compass_SE,
.compass_NW,
.compass_SW,
.compass_flat,
.compass_N,
.compass_E,
.compass_W,
.compass_S {
  filter: drop-shadow(0 8px 16px rgba(4, 12, 22, 0.55));
}

.chat {
  border: 1px solid var(--ui-border);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(165deg, rgba(8, 16, 28, 0.92), rgba(15, 28, 45, 0.84));
  box-shadow: var(--ui-shadow);
  left: 16px;
  margin-left: 0;
  padding: 8px;
  min-width: 280px;
  max-width: min(640px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 8px;
}

.chatinput {
  position: static;
  bottom: auto;
  left: auto;
  display: block;
  grid-column: 1;
  grid-row: 2;
  width: 100% !important;
  max-width: none;
  height: 34px;
  margin: 0;
  border-radius: 9px;
  padding-left: 22px;
  background-color: rgba(9, 17, 29, 0.85);
  border: 1px solid rgba(147, 186, 255, 0.3);
  color: var(--ui-text);
  box-sizing: border-box;
}

.chatinput:focus {
  border-color: rgba(172, 212, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(90, 170, 255, 0.16);
}

.messagelist {
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  margin: 0;
  padding: 4px 6px;
  min-height: 5.5em;
  max-height: 9.5em;
  overflow-y: auto;
  box-sizing: border-box;
}

.chatsendbutton {
  grid-column: 2;
  grid-row: 2;
  position: static !important;
  width: 34px;
  height: 34px;
  margin: 0;
  border: 1px solid rgba(152, 195, 255, 0.38);
  border-radius: 9px;
  color: #eaf3ff;
  background: linear-gradient(150deg, rgba(56, 113, 181, 0.75), rgba(36, 79, 131, 0.85));
}

.loginbutton {
  grid-column: 2;
  grid-row: 2;
  position: static !important;
  align-self: flex-end;
  border-radius: 10px;
  border-color: rgba(152, 195, 255, 0.38);
  color: #eaf3ff;
  font-size: 12px;
  background: linear-gradient(150deg, rgba(56, 113, 181, 0.75), rgba(36, 79, 131, 0.85));
  box-shadow: 0 8px 20px rgba(3, 10, 20, 0.5);
}

.panel .scrollup,
.panel .scrolldown {
  border-color: rgba(150, 188, 251, 0.3);
  border-radius: 8px;
  background-color: rgba(19, 33, 53, 0.72);
}

.panel .scrollup:hover,
.panel .scrolldown:hover {
  border-color: rgba(180, 213, 255, 0.45);
  background-color: rgba(35, 56, 85, 0.82);
}

@media (max-width: 960px) {
  .largeclock {
    width: 168px;
    height: 62px;
  }

  .chat {
    left: 8px;
    max-width: calc(100vw - 16px);
  }

  .messagelist {
    max-width: 100%;
  }

  .chatinput {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .dynmap .sidebar {
    background: linear-gradient(180deg, rgba(8, 15, 25, 0.96), rgba(12, 22, 36, 0.92));
  }

  .dynmap .panel legend {
    font-size: 12px;
  }

  .mobilecompass {
    right: 12px;
    top: 8px;
    filter: drop-shadow(0 4px 10px rgba(2, 8, 16, 0.45));
  }

  .chat {
    display: grid;
    left: 8px;
    right: auto;
    bottom: max(8px, env(safe-area-inset-bottom));
    min-width: 0;
    width: min(280px, calc(100vw - 88px));
    max-width: calc(100vw - 88px);
    padding: 4px;
    gap: 4px;
    z-index: 9000;
    border-radius: 10px;
  }

  .messagelist {
    min-height: 3.6em;
    max-height: 5em;
    font-size: 11px;
    padding: 2px 4px;
  }

  .chatinput {
    height: 30px;
    font-size: 16px;
    border-radius: 8px;
    padding-left: 18px;
  }

  .chatsendbutton,
  .loginbutton {
    min-width: 30px;
    height: 30px;
    font-size: 12px;
    border-radius: 7px;
  }
}
