:root {
  --bg: #1a1a1a;
  --bg-elevated: rgba(28, 28, 28, 0.76);
  --panel: rgba(255, 255, 255, 0.06);
  --panel-strong: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f6f3ef;
  --muted: #c7c0b7;
  --rust: #cd5c5c;
  --rust-strong: #ff4500;
  --rust-soft: #ff8657;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 69, 0, 0.09), transparent 34%),
    radial-gradient(circle at top right, rgba(205, 92, 92, 0.07), transparent 28%),
    linear-gradient(180deg, #121212 0%, #1a1a1a 42%, #111111 100%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black, transparent 88%);
  opacity: 0.55;
}

img,
svg {
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  position: relative;
  isolation: isolate;
}

.glass-panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(36, 36, 36, 0.68), rgba(22, 22, 22, 0.72));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(255, 153, 102, 0.32);
  background:
    linear-gradient(145deg, rgba(255, 113, 69, 0.18), rgba(255, 69, 0, 0.04)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.2));
  color: #fff5ee;
  font-weight: 900;
  letter-spacing: 0.12em;
  overflow: hidden;
}

.brand-mark::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 0 26%, rgba(255, 255, 255, 0.16) 26% 29%, transparent 29% 47%, rgba(255, 255, 255, 0.08) 47% 50%, transparent 50% 100%);
  mix-blend-mode: screen;
  opacity: 0.55;
}

.ui-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 1.875rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #efe7df;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ui-badge--rust {
  border-color: rgba(255, 109, 61, 0.42);
  background: rgba(255, 109, 61, 0.12);
  color: #ffc7b1;
}

.field-label {
  display: block;
  margin-bottom: 0.45rem;
  color: #dfd7cf;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.field-input,
.field-select {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.28);
  padding: 0.9rem 1rem;
  color: var(--text);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.field-input::placeholder {
  color: rgba(255, 255, 255, 0.36);
}

.field-input:focus,
.field-select:focus {
  border-color: rgba(255, 115, 78, 0.52);
  box-shadow: 0 0 0 3px rgba(255, 69, 0, 0.15);
}

.metal-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.9rem;
  padding: 0.8rem 1.15rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 148, 109, 0.36);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
    linear-gradient(135deg, rgba(255, 98, 46, 0.22), rgba(205, 92, 92, 0.12));
  color: #fff6f0;
  font-weight: 700;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 12px 26px rgba(0, 0, 0, 0.22);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.metal-button:hover,
.metal-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 136, 82, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 18px 34px rgba(0, 0, 0, 0.32);
}

.metal-button--ghost {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.metal-button--secondary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01)),
    linear-gradient(135deg, rgba(205, 92, 92, 0.18), rgba(35, 35, 35, 0.12));
}

.metal-button--sm {
  min-height: 2.4rem;
  padding: 0.62rem 0.9rem;
  border-radius: 14px;
  font-size: 0.9rem;
}

.team-tab {
  display: inline-flex;
  min-height: 2.6rem;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #d9d0c5;
  font-weight: 700;
  transition: background 180ms ease, transform 180ms ease, border-color 180ms ease, color 180ms ease;
}

.team-tab:hover,
.team-tab:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.14);
}

.team-tab.is-active {
  border-color: rgba(255, 134, 87, 0.6);
  background: rgba(255, 98, 46, 0.16);
  color: #fff3eb;
  box-shadow: inset 0 0 0 1px rgba(255, 172, 142, 0.08);
}

.metric-card {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.95rem 1rem;
}

.metric-card__eyebrow {
  color: rgba(255, 255, 255, 0.54);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-card__value {
  margin-top: 0.35rem;
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.45;
}

.map-stage {
  position: relative;
  min-height: 72vh;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.82), rgba(6, 6, 6, 0.92));
}

#map {
  width: 100%;
  height: 72vh;
  min-height: 540px;
}

.leaflet-container {
  background: radial-gradient(circle at center, #1a242b, #0e1114 72%);
  font-family: 'Roboto', system-ui, sans-serif;
}

.leaflet-control-zoom {
  border: none !important;
  overflow: hidden;
  border-radius: 16px !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
}

.leaflet-control-zoom a {
  width: 42px !important;
  height: 42px !important;
  line-height: 42px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(22, 22, 22, 0.84) !important;
  color: #fffaf7 !important;
}

.leaflet-control-zoom a:hover {
  background: rgba(255, 98, 46, 0.18) !important;
}

.world-svg {
  width: 100%;
  height: 100%;
}

.world-svg--grid .grid-lines line {
  stroke: rgba(255, 255, 255, 0.11);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.world-svg--grid .grid-labels text {
  fill: rgba(255, 245, 238, 0.28);
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.04em;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.2);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
  user-select: none;
}

.map-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(20, 20, 20, 0.68);
  padding: 0.4rem 0.8rem;
  color: #f1ece6;
  font-size: 0.8rem;
  font-weight: 700;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.zone-pin,
.monument-pin {
  background: transparent;
  border: 0;
}

.zone-pin {
  transition: opacity 220ms ease, transform 220ms ease;
}

.zone-pin.is-hidden {
  opacity: 0;
  transform: scale(0.82);
}

.zone-pin.is-visible {
  opacity: 1;
  transform: scale(1);
}

.zone-pin.is-active .zone-marker {
  transform: scale(1.08);
  border-color: rgba(255, 163, 127, 0.92);
  box-shadow:
    0 0 0 1px rgba(255, 194, 172, 0.15),
    0 18px 42px rgba(0, 0, 0, 0.42),
    0 0 0 10px rgba(255, 98, 46, 0.12);
}

.zone-marker {
  position: relative;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 999px;
  border: 1px solid rgba(255, 158, 115, 0.54);
  background:
    radial-gradient(circle at 28% 26%, rgba(255, 255, 255, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(255, 140, 92, 0.24), rgba(255, 69, 0, 0.12) 46%, rgba(18, 18, 18, 0.96) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 14px 30px rgba(0, 0, 0, 0.34);
  color: #fff8f4;
  text-align: center;
  transform: scale(1);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.zone-marker::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 1px dashed rgba(255, 158, 115, 0.18);
}

.zone-marker__score {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1;
}

.zone-marker__grid {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.zone-marker__fit {
  display: block;
  margin-top: 0.2rem;
  max-width: 70px;
  color: rgba(255, 240, 231, 0.72);
  font-size: 0.6rem;
  line-height: 1.2;
}

.monument-pin__inner {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(16, 16, 16, 0.88);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.monument-pin__inner--safe {
  border-color: rgba(125, 211, 149, 0.5);
  color: #d1fae5;
}

.monument-pin__inner--loot,
.monument-pin__inner--utility,
.monument-pin__inner--resource {
  border-color: rgba(251, 191, 36, 0.46);
  color: #fef3c7;
}

.monument-pin__inner--high {
  border-color: rgba(248, 113, 113, 0.62);
  color: #fee2e2;
}

.rust-tooltip {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(16, 16, 16, 0.92);
  color: #fff7f1;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
}

.rust-tooltip::before {
  border-top-color: rgba(16, 16, 16, 0.92) !important;
}

.zone-drawer {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 700;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: min(76vh, 680px);
  overflow: auto;
  padding: 1rem;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(20, 20, 20, 0.86), rgba(11, 11, 11, 0.92));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.44);
  transform: translateY(calc(100% + 18px));
  transition: transform 260ms ease;
}

.zone-drawer.is-open {
  transform: translateY(0);
}

.drawer-close {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.drawer-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff7f1;
}

.drawer-subtitle {
  margin-top: 0.25rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.88rem;
}

.detail-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.9rem;
  padding: 0.3rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 143, 107, 0.32);
  background: rgba(255, 100, 48, 0.14);
  color: #fff2ec;
  font-size: 0.76rem;
  font-weight: 700;
}

.detail-chip--subtle {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #ede4da;
}

.detail-stat {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.85rem 0.9rem;
}

.detail-stat__label {
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-stat__value {
  margin-top: 0.3rem;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
}

.detail-list {
  margin: 0;
  padding-left: 1.2rem;
  color: #eee3d9;
}

.detail-list li {
  margin-bottom: 0.65rem;
  line-height: 1.55;
}

.monument-distance-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.monument-distance-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f4ede6;
  font-size: 0.88rem;
}

.sponsored-card {
  border-radius: 22px;
  border: 1px solid rgba(255, 160, 124, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    linear-gradient(135deg, rgba(255, 102, 51, 0.11), rgba(255, 255, 255, 0.01));
  padding: 1rem;
}

.server-ip-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 2rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.22);
  color: #fdf1ea;
  font-size: 0.72rem;
  font-weight: 700;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.58);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-panel {
  position: relative;
  width: min(100%, 520px);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(31, 31, 31, 0.96), rgba(15, 15, 15, 0.98));
  padding: 1.35rem;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 1.25rem;
  z-index: 900;
  min-width: 220px;
  max-width: min(90vw, 420px);
  padding: 0.85rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(14, 14, 14, 0.88);
  color: #fffaf5;
  text-align: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 200ms ease, opacity 200ms ease;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

@media (min-width: 1024px) {
  .zone-drawer {
    top: 16px;
    bottom: 16px;
    left: auto;
    right: 16px;
    width: min(360px, calc(100% - 32px));
    transform: translateX(calc(100% + 22px));
  }

  .zone-drawer.is-open {
    transform: translateX(0);
  }
}

@media (max-width: 767px) {
  #map {
    height: 68vh;
    min-height: 460px;
  }

  .world-svg--grid .grid-labels text {
    font-size: 26px;
  }

  .zone-marker {
    width: 76px;
    height: 76px;
  }

  .zone-marker__score {
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
