:root {
  color-scheme: dark;
  --bg: #121218;
  --bg-deep: #0d0d12;
  --panel: rgba(29, 27, 38, 0.94);
  --panel-2: rgba(42, 36, 54, 0.92);
  --line: rgba(164, 94, 255, 0.24);
  --line-strong: rgba(177, 98, 255, 0.58);
  --text: #fffaff;
  --muted: #c4bccd;
  --muted-2: #8f879a;
  --purple: #b45cff;
  --purple-2: #7d4ee6;
  --pink: #ff3fb4;
  --red: #ff1d25;
  --cyan: #36d5ff;
  --amber: #ffb02e;
  --green: #4df0a7;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.44);
  --radius: 18px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(13, 11, 18, 0.72) 0%, rgba(12, 10, 18, 0.88) 52%, rgba(13, 13, 18, 0.96) 100%),
    #0d0b13;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(9, 8, 14, 0.58) 0%, rgba(9, 8, 14, 0.84) 72%, rgba(9, 8, 14, 0.96) 100%),
    url("./assets/pekarni-bg-wide.png") center top / cover no-repeat;
  opacity: 0.74;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(190, 112, 255, 0.52) 0 1px, transparent 1.7px),
    radial-gradient(circle, rgba(255, 255, 255, 0.34) 0 1px, transparent 1.6px),
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 118px 118px, 176px 176px, 44px 44px, 44px 44px;
  background-position: 0 0, 42px 18px, 0 0, 0 0;
  opacity: 0.32;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 12%, #000 82%, transparent 100%);
  animation: particles-drift 28s linear infinite;
}

button,
select,
input {
  font: inherit;
}

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

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  overflow-x: clip;
}

@keyframes particles-drift {
  from {
    background-position: 0 0, 42px 18px, 0 0, 0 0;
  }
  to {
    background-position: 118px 236px, -134px 194px, 44px 44px, 44px 44px;
  }
}

[data-page] {
  display: none !important;
}

[data-page].is-active-page {
  display: flex !important;
}

.section[data-page].is-active-page {
  display: block !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 78px;
  padding: 14px clamp(20px, 6vw, 86px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 34px;
  background: rgba(23, 17, 29, 0.82);
  backdrop-filter: blur(22px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.brand-logo {
  width: 214px;
  height: 64px;
  display: block;
  color: transparent;
  font-size: 0;
  line-height: 0;
  background: url("./assets/pekarni-wordmark-clean.png?v=20260612-4") center 42% / contain no-repeat;
  filter: drop-shadow(0 0 18px rgba(198, 44, 255, 0.34));
  transform: translateY(-6px);
}

.brand-text {
  display: none;
  gap: 2px;
}

.brand-text strong {
  font-size: 21px;
  line-height: 1;
  white-space: nowrap;
  color: var(--purple);
  text-transform: uppercase;
}

.brand-text small {
  color: var(--muted-2);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0;
}

.topnav {
  display: flex;
  justify-content: center;
  gap: clamp(18px, 2.8vw, 36px);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 14px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.topnav::-webkit-scrollbar {
  display: none;
}

.topnav a {
  position: relative;
  padding: 14px 0;
}

.topnav a.is-active,
.topnav a:hover {
  color: var(--purple);
}

.topnav a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 3px;
  border-radius: 999px;
  background: var(--purple);
  box-shadow: 0 0 18px rgba(198, 44, 255, 0.82);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.social-button,
.auth-top,
.primary-top,
.wide-action {
  min-height: 44px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.social-button {
  width: 44px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  color: #ceb2db;
}

.auth-top {
  padding: 0 14px;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
}

.auth-top:hover {
  color: white;
  border-color: var(--line-strong);
}

.auth-top svg,
.primary-top svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.auth-top,
.primary-top {
  gap: 8px;
}

.primary-top {
  min-width: 152px;
  padding: 0 18px;
  background: linear-gradient(135deg, #d84cff, #9b2eed);
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 0 10px 28px rgba(198, 44, 255, 0.22);
  flex-shrink: 0;
}

.hero-map {
  min-height: auto;
  display: flex;
  flex-direction: column;
  padding-bottom: 34px;
}

.hero-copy {
  padding: 16px 24px 14px;
  text-align: center;
}

.hero-copy p,
.section-title p,
.panel-head p {
  margin: 0 0 8px;
  color: var(--purple);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0;
}

.hero-copy h1,
.section-title h2,
.panel-head h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1;
  letter-spacing: 0;
}

.hero-copy h1 {
  font-size: clamp(28px, 2.7vw, 40px);
}

.map-stage {
  position: relative;
  width: min(1180px, calc(100vw - 40px));
  aspect-ratio: 1 / 1;
  min-height: 0;
  margin: 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  overflow: hidden;
  background: #111722;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.52);
}

.map-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #0f1720;
  cursor: grab;
  touch-action: none;
}

.map-canvas.is-dragging {
  cursor: grabbing;
}

.map-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(19, 10, 27, 0.12), transparent 18%, transparent 82%, rgba(19, 10, 27, 0.24)),
    linear-gradient(180deg, rgba(17, 11, 22, 0.08), transparent 36%, rgba(17, 11, 22, 0.1)),
    radial-gradient(circle at 52% 51%, transparent 0 22%, rgba(0, 0, 0, 0.08) 44%, rgba(0, 0, 0, 0.32) 100%);
}

.map-viewport {
  position: absolute;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  will-change: transform;
}

.map-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  user-select: none;
  pointer-events: none;
}

.map-controls {
  position: absolute;
  z-index: 30;
  inset: 16px 16px auto 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  pointer-events: none;
}

.server-picker-button,
.server-menu,
.scope-tabs,
.status-tabs,
.filter-tabs,
.map-search-panel,
.map-tools,
.map-focus-card,
.system-dock,
.panel,
.system-card,
.help-card {
  background: rgba(34, 21, 48, 0.92);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.server-picker {
  position: relative;
  width: 252px;
  pointer-events: auto;
}

.map-left-stack {
  display: grid;
  gap: 10px;
  width: min(360px, 36vw);
  pointer-events: none;
}

.map-left-stack .server-picker,
.map-search-panel {
  width: 100%;
  pointer-events: auto;
}

.map-search-panel {
  min-height: 54px;
  border-radius: 10px;
  padding: 8px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}

.map-search-panel input {
  min-width: 0;
  height: 34px;
  border: 0;
  color: white;
  background: transparent;
  outline: none;
}

.map-search-panel button {
  height: 34px;
  border-radius: 8px;
  padding: 0 12px;
  color: white;
  background: rgba(198, 44, 255, 0.28);
  cursor: pointer;
  font-weight: 850;
}

.map-search-panel .map-search-clear {
  width: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
}

.map-search-panel .map-search-clear[hidden] {
  display: none;
}

.map-search-clear span {
  display: none;
}

.map-search-clear svg {
  width: 18px;
  height: 18px;
}

.map-search-panel small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.map-search-panel small[data-tone="good"] {
  color: var(--green);
}

.map-search-panel small[data-tone="bad"] {
  color: #ff7781;
}

.server-picker-button {
  width: 100%;
  min-height: 54px;
  border-radius: 10px;
  display: grid;
  align-items: center;
  grid-template-columns: 1fr auto 22px;
  gap: 12px;
  padding: 0 14px;
  color: var(--text);
  cursor: pointer;
}

.server-picker-button span {
  color: var(--text);
  font-weight: 900;
  font-size: 13px;
}

.server-picker-button strong {
  font-weight: 800;
}

.server-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 0;
  width: min(360px, calc(100vw - 40px));
  border-radius: 10px;
  padding: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.server-menu:not([hidden]) {
  display: grid;
}

.server-menu[hidden] {
  display: none;
}

.server-menu button {
  min-height: 36px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  font-weight: 850;
}

.server-menu button.is-active,
.server-menu button:hover {
  color: white;
  background: linear-gradient(135deg, rgba(198, 44, 255, 0.44), rgba(143, 36, 219, 0.42));
}

.map-filter-stack {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.scope-tabs {
  min-height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  pointer-events: auto;
}

.status-tabs {
  min-height: 42px;
  border-radius: 10px;
  display: flex;
  gap: 6px;
  padding: 6px;
  pointer-events: auto;
}

.status-tabs {
  display: none !important;
}

.scope-tabs button,
.status-tabs button {
  min-height: 30px;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 850;
  white-space: nowrap;
}

.scope-tabs button.is-active,
.status-tabs button.is-active {
  color: white;
  background: rgba(198, 44, 255, 0.2);
}

.filter-tabs {
  min-height: 54px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  pointer-events: auto;
}

.filter-tabs button {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 850;
  white-space: nowrap;
}

.filter-tabs button span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 14px rgba(198, 44, 255, 0.8);
}

.filter-tabs button.is-active {
  color: white;
  background: rgba(198, 44, 255, 0.16);
}

.filter-tabs button:not(.is-active) span {
  background: #65506f;
  box-shadow: none;
}

.markers-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.map-marker {
  position: absolute;
  width: var(--marker-size, 22px);
  height: var(--marker-size, 22px);
  margin:
    calc(var(--marker-size, 22px) * -0.5 + var(--marker-y-nudge, 0px))
    0
    0
    calc(var(--marker-size, 22px) * -0.5);
  display: grid;
  place-items: center;
  border-radius: 0;
  color: white;
  background: transparent;
  border: 0;
  box-sizing: border-box;
  padding: 0;
  box-shadow: none;
  filter: none;
  cursor: pointer;
  transform: translateZ(0);
  transform-origin: center;
  transition: opacity 120ms ease;
  backface-visibility: hidden;
}

.markers-layer[data-dense="true"] .map-marker {
  width: var(--marker-dense-size, 18px);
  height: var(--marker-dense-size, 18px);
  margin:
    calc(var(--marker-dense-size, 18px) * -0.5 + var(--marker-y-nudge, 0px))
    0
    0
    calc(var(--marker-dense-size, 18px) * -0.5);
}

.map-marker:hover,
.map-marker.is-active {
  transform: scale(var(--marker-active-scale, 1.22));
  filter: none;
}

.map-marker img {
  width: var(--marker-icon-size, 16px);
  height: var(--marker-icon-size, 16px);
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
}

.map-marker.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.map-cluster {
  position: absolute;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.22), transparent 34%),
    linear-gradient(135deg, rgba(198, 44, 255, 0.92), rgba(255, 49, 117, 0.86));
  border: 1px solid rgba(255, 255, 255, 0.48);
  box-sizing: border-box;
  padding: 0;
  box-shadow: 0 0 0 6px rgba(198, 44, 255, 0.18), 0 12px 24px rgba(0, 0, 0, 0.42);
  cursor: pointer;
  transform: scale(var(--marker-scale, 1));
  transform-origin: center;
}

.map-cluster span {
  font-size: 12px;
  font-weight: 950;
}

.map-cluster:hover {
  transform: scale(var(--marker-cluster-hover-scale, 1.22));
}

.system-dock {
  position: absolute;
  z-index: 6;
  right: 16px;
  bottom: 16px;
  width: 300px;
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.map-tools {
  position: absolute;
  z-index: 9;
  left: 20px;
  top: 170px;
  border-radius: 10px;
  padding: 6px;
  display: grid;
  gap: 6px;
}

.map-tools button {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: white;
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
}

.map-tools button:hover {
  background: rgba(198, 44, 255, 0.22);
}

.map-focus-card {
  position: absolute;
  z-index: 35;
  left: 20px;
  bottom: 20px;
  width: min(430px, calc(100% - 40px));
  border-radius: 12px;
  padding: 14px 44px 14px 14px;
  display: grid;
  gap: 12px;
}

.focus-card-top {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
}

.map-focus-card .focus-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--purple);
  background: rgba(198, 44, 255, 0.15);
}

.map-focus-card .focus-icon img,
.asset-marker img,
.event-icon img {
  width: 22px;
  height: 22px;
  display: block;
  image-rendering: pixelated;
}

.map-focus-card strong,
.map-focus-card span {
  display: block;
}

.map-focus-card span {
  color: var(--muted);
  font-size: 13px;
}

.focus-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.focus-detail-grid div {
  min-width: 0;
  border-radius: 10px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.06);
}

.focus-detail-grid span {
  color: var(--muted-2);
  font-size: 11px;
  text-transform: uppercase;
}

.focus-detail-grid strong {
  margin-top: 3px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.focus-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.dock-card {
  min-height: 66px;
  border-radius: 12px;
  padding: 10px;
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dock-card span {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--purple);
  background: rgba(198, 44, 255, 0.14);
}

.dock-card.is-online span {
  color: var(--green);
  background: rgba(77, 240, 167, 0.12);
}

.dock-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.dock-card strong {
  display: block;
  margin-top: 2px;
  font-size: 25px;
  line-height: 1;
}

.section {
  padding: 88px clamp(20px, 7vw, 104px);
  scroll-margin-top: 124px;
}

.section-title {
  max-width: 760px;
  margin-bottom: 30px;
}

.online-section {
  min-height: calc(100vh - 78px);
}

.online-dashboard {
  max-width: 1080px;
  margin: 0 auto;
  background: rgba(18, 18, 19, 0.94);
  border-color: rgba(255, 255, 255, 0.14);
}

.online-head {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.online-head > div {
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.online-head span,
.online-legend em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.online-head strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(28px, 4vw, 44px);
}

#onlineValue,
#onlinePageValue,
#onlineLegendValue {
  font-variant-numeric: tabular-nums;
  transition: color 180ms ease, text-shadow 180ms ease, transform 180ms ease;
  color: white;
}

#onlineValue.is-counting,
#onlinePageValue.is-counting,
#onlineLegendValue.is-counting {
  color: #22e0a6;
  text-shadow: 0 0 24px rgba(34, 224, 166, 0.36);
}

#onlineValue[data-trend="up"],
#onlinePageValue[data-trend="up"],
#onlineLegendValue[data-trend="up"] {
  color: #22e0a6;
}

#onlineValue[data-trend="down"],
#onlinePageValue[data-trend="down"],
#onlineLegendValue[data-trend="down"] {
  color: #ff7f9b;
}

#onlineValue[data-trend="neutral"],
#onlinePageValue[data-trend="neutral"],
#onlineLegendValue[data-trend="neutral"] {
  color: white;
  text-shadow: none;
}

.online-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.online-periods button {
  min-height: 36px;
  border-radius: 8px;
  padding: 0 16px;
  color: #d7d7d7;
  background: #2d2d30;
  cursor: pointer;
  font-weight: 850;
}

.online-periods button.is-active {
  color: #111;
  background: #91e700;
}

.online-chart-shell {
  position: relative;
  min-height: 360px;
  border-radius: 10px;
  padding: 12px;
  background: #111;
  overflow: hidden;
}

.online-chart {
  width: 100%;
  height: 340px;
  display: block;
}

.auth-modal[hidden] {
  display: none;
}

.auth-modal {
  position: fixed;
  z-index: 140;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(198, 44, 255, 0.18), transparent 34%),
    radial-gradient(circle at 80% 80%, rgba(18, 196, 147, 0.12), transparent 26%),
    rgba(7, 4, 12, 0.8);
  backdrop-filter: blur(14px);
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 24px));
  border-radius: 22px;
  padding: 26px 26px 22px;
  display: grid;
  justify-items: center;
  gap: 14px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(34, 18, 52, 0.98), rgba(16, 12, 23, 0.98)),
    rgba(18, 18, 19, 0.98);
  border: 1px solid rgba(198, 44, 255, 0.24);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.auth-orbit {
  position: absolute;
  border-radius: 999px;
  filter: blur(8px);
  pointer-events: none;
}

.auth-orbit-a {
  top: -42px;
  left: -14px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(198, 44, 255, 0.28), transparent 68%);
}

.auth-orbit-b {
  right: -56px;
  bottom: -82px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(18, 196, 147, 0.18), transparent 68%);
}

.auth-back,
.auth-close {
  position: absolute;
  top: 24px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: white;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.auth-back {
  left: 24px;
}

.auth-close {
  right: 24px;
}

.auth-card h2,
.auth-card p {
  margin: 0;
}

.auth-kicker {
  width: 100%;
  padding: 0 54px;
  color: var(--purple);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-card h2 {
  width: 100%;
  min-height: 40px;
  padding: 0 54px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 29px;
  line-height: 1.2;
  color: #f4effa;
}

.auth-card p {
  color: var(--muted);
  line-height: 1.45;
  text-align: center;
}

.auth-copy {
  max-width: 420px;
  font-size: 16px;
}

.auth-copy strong {
  color: #fff;
}

.auth-bot-chip {
  min-height: 40px;
  border-radius: 999px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-bot-chip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-bot-chip strong {
  color: #fff;
  font-size: 14px;
}

.auth-bot-chip[hidden],
.auth-qr-frame[hidden],
.auth-link[hidden],
.auth-qr[hidden] {
  display: none;
}

.auth-qr-frame {
  width: min(100%, 270px);
  border-radius: 24px;
  padding: 14px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(198, 44, 255, 0.28), rgba(18, 196, 147, 0.16)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.auth-qr {
  width: 220px;
  height: 220px;
  justify-self: center;
  border-radius: 18px;
  padding: 10px;
  background: white;
}

.auth-meta {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.auth-links {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.auth-link {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #f8f3ff;
  font-weight: 800;
  text-align: center;
}

.auth-link svg {
  width: 18px;
  height: 18px;
}

.auth-link-primary {
  background: linear-gradient(135deg, rgba(198, 44, 255, 0.98), rgba(148, 60, 255, 0.92));
  box-shadow: 0 16px 34px rgba(160, 56, 255, 0.28);
}

.auth-link-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-command {
  width: 100%;
  display: grid;
  gap: 7px;
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

.auth-command[hidden] {
  display: none;
}

.auth-command span,
.auth-role-note,
.auth-status,
.auth-timer,
.admin-bot-label,
.admin-bot-status,
.admin-action-status,
.admin-card small {
  color: var(--muted);
  font-size: 13px;
}

.auth-timer {
  min-height: 18px;
  font-weight: 700;
}

.auth-command code {
  overflow-wrap: anywhere;
  color: white;
  font-weight: 850;
}

.auth-role-note {
  max-width: 420px;
}

.auth-status[data-tone="good"],
.admin-bot-status[data-tone="good"],
.admin-action-status[data-tone="good"] {
  color: var(--green);
}

.auth-status[data-tone="bad"],
.admin-bot-status[data-tone="bad"],
.admin-action-status[data-tone="bad"] {
  color: #ff7f9b;
}

.auth-status[data-tone="wait"] {
  color: #ff5959;
}

.auth-status[data-tone="wait"]::before {
  content: "";
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border-radius: 50%;
  display: inline-block;
  vertical-align: -2px;
  border: 2px solid rgba(255, 89, 89, 0.28);
  border-top-color: #ff5959;
  animation: auth-spin 850ms linear infinite;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

.auth-refresh {
  min-height: 42px;
  border-radius: 12px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #f8f3ff;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-weight: 800;
}

.admin-bot-form {
  margin-top: 18px;
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.admin-bot-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-bot-head p,
.admin-bot-head h3 {
  margin: 0;
}

.admin-bot-head p {
  color: var(--purple);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-bot-head h3 {
  margin-top: 4px;
  font-size: 18px;
}

.admin-bot-source {
  min-height: 30px;
  border-radius: 999px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  color: #fff;
  background: rgba(198, 44, 255, 0.16);
  border: 1px solid rgba(198, 44, 255, 0.24);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-bot-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.admin-bot-row input {
  min-height: 46px;
  border-radius: 10px;
  padding: 0 14px;
  color: white;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-bot-row button,
.admin-bot-reset {
  min-height: 44px;
  border-radius: 10px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  font-weight: 850;
  cursor: pointer;
}

.admin-bot-row button {
  background: linear-gradient(135deg, rgba(198, 44, 255, 0.94), rgba(148, 60, 255, 0.88));
}

.admin-bot-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-bot-footer small {
  display: block;
}

.admin-bot-reset {
  min-width: 92px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-section {
  min-height: calc(100vh - 78px);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.admin-status-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.admin-card {
  min-height: 112px;
  border-radius: 10px;
  padding: 14px;
  display: grid;
  align-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-card span {
  color: var(--purple);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-card strong {
  font-size: 24px;
  overflow-wrap: anywhere;
}

.admin-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.admin-detail-box {
  border-radius: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.075);
}

.admin-detail-box + .admin-detail-box {
  margin-top: 10px;
}

.admin-details-grid .admin-detail-box + .admin-detail-box {
  margin-top: 0;
}

.admin-detail-box h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.admin-kv-list,
.admin-session-list {
  display: grid;
  gap: 8px;
}

.admin-kv-list div,
.admin-session-row {
  min-height: 38px;
  border-radius: 8px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.16);
}

.admin-kv-list span,
.admin-session-row span,
.admin-empty {
  color: var(--muted);
  font-size: 13px;
}

.admin-kv-list strong,
.admin-session-row strong {
  text-align: right;
  overflow-wrap: anywhere;
}

.admin-session-row {
  grid-template-columns: 90px minmax(0, 1fr) auto;
}

.admin-session-row small {
  color: var(--muted-2);
}

.admin-actions {
  display: grid;
  gap: 10px;
}

.admin-actions button {
  min-height: 46px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: white;
  background: rgba(198, 44, 255, 0.22);
  border: 1px solid rgba(198, 44, 255, 0.28);
  cursor: pointer;
  font-weight: 900;
}

.admin-actions button:hover {
  background: rgba(198, 44, 255, 0.34);
}

.admin-action-status {
  min-height: 22px;
  margin-top: 12px;
}

.chart-grid line {
  stroke: rgba(255, 255, 255, 0.08);
}

.chart-grid text {
  fill: rgba(255, 255, 255, 0.42);
  font-size: 12px;
  text-anchor: end;
}

.chart-area {
  fill: url(#onlineArea);
}

.chart-line {
  fill: none;
  stroke: #12c493;
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-hover-line {
  stroke: rgba(180, 92, 255, 0.72);
  stroke-width: 2;
  stroke-dasharray: 5 5;
}

.chart-hover-dot {
  fill: #f2e9ff;
  stroke: var(--purple);
  stroke-width: 3;
  filter: drop-shadow(0 0 10px rgba(180, 92, 255, 0.78));
}

.online-point-value {
  display: none;
}

.online-chart-tooltip {
  position: absolute;
  z-index: 4;
  min-width: 198px;
  border-radius: 8px;
  padding: 12px 14px;
  color: #f7f4fb;
  background: rgba(18, 18, 20, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.online-chart-tooltip[hidden] {
  display: none;
}

.online-chart-tooltip em {
  display: block;
  margin-bottom: 8px;
  color: #bdb7c7;
  font-style: normal;
  font-size: 13px;
}

.online-chart-tooltip span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f7f4fb;
  font-size: 14px;
  font-weight: 850;
}

.online-chart-tooltip b {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #18d29b;
  box-shadow: 0 0 0 3px rgba(24, 210, 155, 0.12);
}

.online-chart-tooltip strong {
  margin-left: auto;
  font-size: 15px;
}

.online-empty-state {
  position: absolute;
  inset: 12px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 15px;
  font-weight: 850;
  text-align: center;
  pointer-events: none;
}

.online-empty-state[hidden] {
  display: none;
}

.online-legend {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  color: var(--muted);
}

.online-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.online-legend b {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #12c493;
}

.section-title h2,
.panel-head h2 {
  font-size: clamp(30px, 3vw, 42px);
}

.systems-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.compare-result-modern {
  display: grid;
  gap: 14px;
}

.compare-winner {
  border-radius: 12px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: linear-gradient(135deg, rgba(77, 240, 167, 0.13), rgba(198, 44, 255, 0.15));
  border: 1px solid rgba(77, 240, 167, 0.24);
}

.compare-winner span {
  color: var(--muted);
}

.compare-winner strong {
  font-size: 20px;
}

.compare-modern-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.compare-player-card {
  min-width: 0;
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.compare-player-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.compare-player-head span,
.compare-stat-grid span {
  color: var(--muted);
  font-size: 12px;
}

.compare-player-head strong,
.compare-player-head b {
  display: block;
  margin-top: 3px;
  font-size: 18px;
}

.compare-meter {
  height: 9px;
  border-radius: 999px;
  margin: 14px 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.compare-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--purple));
}

.compare-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.compare-stat-grid div {
  border-radius: 10px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.05);
}

.compare-stat-grid strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.compare-mini-list {
  display: grid;
  gap: 8px;
}

.system-card,
.help-card {
  min-height: 210px;
  border-radius: var(--radius);
  padding: 24px;
}

.system-card {
  cursor: pointer;
}

button.help-card {
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.help-card.is-active {
  border-color: var(--purple);
  box-shadow: 0 18px 54px rgba(198, 44, 255, 0.24);
}

.system-card i,
.help-card i,
.panel-head > i {
  color: var(--purple);
}

.system-card svg,
.help-card svg {
  width: 40px;
  height: 40px;
}

.system-card h3,
.help-card strong {
  display: block;
  margin: 26px 0 10px;
  font-size: 22px;
}

.system-card p,
.help-card span {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.workbench,
.alerts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(340px, 0.7fr);
  gap: 18px;
  align-items: start;
  overflow: visible;
}

.panel {
  border-radius: var(--radius);
  padding: 22px;
  overflow: visible;
}

.player-panel,
.leaderboard-panel {
  position: relative;
}

.player-panel {
  z-index: 2;
}

.player-panel:has(.mini-server-menu:not([hidden])) {
  z-index: 30;
}

.leaderboard-panel {
  z-index: 1;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 20px;
}

.panel-head svg {
  width: 36px;
  height: 36px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 18px;
}

.mode-tabs button {
  min-height: 46px;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 850;
}

.mode-tabs button.is-active {
  color: white;
  background: linear-gradient(135deg, rgba(198, 44, 255, 0.38), rgba(143, 36, 219, 0.42));
}

.search-form {
  display: grid;
  gap: 12px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 12px;
}

.compare-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.server-grid {
  grid-template-columns: 180px;
}

.input-wrap {
  display: grid;
  gap: 7px;
}

.input-wrap label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.input-wrap input,
.input-wrap select {
  min-height: 52px;
  border-radius: 10px;
  border: 1px solid rgba(201, 62, 255, 0.3);
  background: rgba(10, 6, 14, 0.46);
  color: white;
  outline: 0;
  padding: 0 14px;
}

.input-wrap select option {
  color: #1b1026;
}

.mini-server-picker {
  position: relative;
}

.mini-server-picker:has(.mini-server-menu:not([hidden])) {
  z-index: 90;
}

.mini-server-picker input[type="hidden"] {
  display: none;
}

.mini-server-button {
  width: 100%;
  min-height: 52px;
  border-radius: 10px;
  border: 1px solid rgba(201, 62, 255, 0.3);
  background: rgba(10, 6, 14, 0.46);
  color: white;
  display: grid;
  grid-template-columns: 1fr 22px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  cursor: pointer;
}

.mini-server-button strong {
  justify-self: start;
}

.mini-server-menu {
  position: absolute;
  z-index: 120;
  top: var(--mini-menu-top, calc(100% + 8px));
  bottom: var(--mini-menu-bottom, auto);
  left: var(--mini-menu-left, 0px);
  width: var(--mini-menu-width, min(332px, calc(100vw - 32px)));
  max-height: var(--mini-menu-max-height, 260px);
  overflow: auto;
  border-radius: 12px;
  padding: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  background: rgba(34, 21, 48, 0.98);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}

.mini-server-menu:not([hidden]) {
  display: grid;
}

.mini-server-menu[hidden] {
  display: none;
}

.mini-server-menu button {
  min-height: 36px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  font-weight: 850;
}

.mini-server-menu button.is-active,
.mini-server-menu button:hover {
  color: white;
  background: rgba(198, 44, 255, 0.26);
}

.wide-action {
  width: 100%;
  margin-top: 4px;
  background: linear-gradient(135deg, #d84cff, #8f24db);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 900;
}

.result-panel {
  margin-top: 18px;
}

.player-result,
.compare-result {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(201, 62, 255, 0.28);
  background: rgba(11, 7, 16, 0.46);
}

.result-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.result-top h3 {
  margin: 0 0 6px;
  font-size: 24px;
}

.result-top p,
.asset-row span,
.event-item span,
.leader-row span {
  color: var(--muted);
}

.worth {
  color: var(--purple);
  font-size: 28px;
  font-weight: 950;
  white-space: nowrap;
}

.asset-row,
.leader-row,
.event-item {
  display: grid;
  align-items: center;
  gap: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.asset-row {
  grid-template-columns: 40px 1fr auto;
  min-height: 64px;
  padding: 12px 18px;
}

.asset-button,
.event-button {
  width: 100%;
  color: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.asset-button:hover,
.event-button:hover {
  background: rgba(198, 44, 255, 0.08);
}

.asset-row:first-child,
.leader-row:first-child,
.event-item:first-child {
  border-top: 0;
}

.asset-marker,
.event-icon {
  color: var(--purple);
}

.asset-marker {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(198, 44, 255, 0.13);
}

.asset-row strong,
.leader-row strong,
.event-item strong {
  display: block;
}

.asset-price {
  font-weight: 900;
  white-space: nowrap;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.summary-strip div {
  padding: 14px 18px;
  background: rgba(24, 15, 34, 0.72);
}

.summary-strip span,
.mini-empty,
.compare-player-block > span {
  color: var(--muted);
}

.summary-strip span,
.summary-strip strong {
  display: block;
}

.summary-strip strong {
  margin-top: 4px;
  font-size: 18px;
}

.leaderboard-list,
.event-feed {
  display: grid;
}

.leader-row {
  grid-template-columns: 42px 1fr auto;
  min-height: 60px;
  padding: 12px 0;
}

.leader-button {
  width: 100%;
  color: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.leader-button:hover {
  background: rgba(198, 44, 255, 0.08);
}

.leader-place {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: white;
  background: rgba(198, 44, 255, 0.16);
  border: 1px solid rgba(198, 44, 255, 0.3);
  font-weight: 900;
}

.compare-bars {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.compare-assets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0 18px 18px;
}

.compare-player-block {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.compare-player-block > strong,
.compare-player-block > span,
.mini-empty {
  display: block;
  padding: 12px 14px;
}

.compare-player-block .asset-row {
  grid-template-columns: 32px 1fr;
}

.compare-player-block .asset-price {
  display: none;
}

.compare-line {
  display: grid;
  gap: 8px;
}

.compare-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  gap: 12px;
}

.bar {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple-2), var(--purple));
}

.alerts-layout {
  display: block;
}

.alerts-grid {
  grid-template-columns: minmax(0, 1fr) 380px;
}

.alerts-server-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.alerts-server-copy span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.alerts-server-copy strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.event-item {
  grid-template-columns: 46px 1fr auto;
  min-height: 76px;
  padding: 12px 0;
}

.event-list-meta,
.event-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.event-list-meta strong {
  color: white;
}

.event-pager {
  justify-content: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 0;
  padding-top: 12px;
}

.event-pager button {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: white;
  background: rgba(198, 44, 255, 0.16);
  border: 1px solid rgba(198, 44, 255, 0.28);
  cursor: pointer;
}

.event-pager button:disabled {
  opacity: 0.45;
  cursor: default;
}

.event-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(198, 44, 255, 0.15);
}

.event-time {
  color: var(--amber);
  font-weight: 900;
  white-space: nowrap;
}

.data-status {
  color: var(--muted);
  font-size: 12px;
  margin-top: 10px;
}

.toggle-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.toggle-row:first-of-type {
  border-top: 0;
}

.toggle-row strong {
  display: block;
}

.toggle-row span {
  color: var(--muted);
}

.switch {
  width: 56px;
  height: 32px;
  border-radius: 999px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.switch span {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #94839e;
  transition: transform 160ms ease, background 160ms ease;
}

.switch.is-on {
  background: rgba(198, 44, 255, 0.24);
  border-color: var(--line-strong);
}

.switch.is-on span {
  transform: translateX(24px);
  background: var(--purple);
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.help-details {
  margin-top: 18px;
}

.help-detail-panel {
  max-width: 100%;
}

.terms-grid,
.birthdays-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.terms-grid div,
.birthday-year-card {
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.terms-grid strong,
.terms-grid span,
.birthdays-grid strong,
.birthdays-grid span,
.birthdays-grid b,
.birthdays-grid em {
  display: block;
}

.terms-grid span,
.birthdays-grid span {
  color: var(--muted);
  margin-top: 6px;
}

.birthday-year-card > strong {
  color: white;
  font-size: 18px;
}

.birthday-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.birthday-items span {
  min-height: 54px;
  margin: 0;
  border-radius: 10px;
  padding: 10px;
  background: rgba(198, 44, 255, 0.09);
  border: 1px solid rgba(198, 44, 255, 0.16);
}

.birthday-items b {
  color: white;
  font-size: 16px;
}

.birthday-items em {
  margin-top: 3px;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.map-tooltip {
  position: absolute;
  z-index: 10;
  min-width: 220px;
  padding: 14px;
  border-radius: 12px;
  pointer-events: none;
  background: rgba(24, 15, 34, 0.96);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  transform: translate(14px, -50%);
}

.map-tooltip strong {
  display: block;
  margin-bottom: 4px;
}

.map-tooltip span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.is-hidden {
  display: none !important;
}

.site-disclaimer {
  width: min(1180px, calc(100% - 36px));
  margin: 54px auto 0;
  padding: 18px 20px 26px;
  color: rgba(221, 211, 232, 0.72);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
  border-top: 1px solid rgba(180, 92, 255, 0.2);
}

@media (orientation: portrait) {
  body::before {
    background:
      linear-gradient(180deg, rgba(9, 8, 14, 0.52) 0%, rgba(9, 8, 14, 0.84) 72%, rgba(9, 8, 14, 0.96) 100%),
      url("./assets/pekarni-bg-mobile.png") center top / cover no-repeat;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::after {
    animation: none;
  }
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topnav {
    grid-column: 1 / -1;
    order: 3;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .system-dock {
    width: auto;
    left: 20px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .systems-grid,
  .help-grid,
  .terms-grid,
  .birthdays-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workbench,
  .alerts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .map-stage {
    min-height: 760px;
  }

  .map-controls {
    inset: 16px 16px auto 16px;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    width: min(520px, calc(100% - 32px));
    gap: 10px;
  }

  .server-picker,
  .map-filter-stack,
  .scope-tabs,
  .filter-tabs {
    width: 100%;
  }

  .map-filter-stack {
    justify-items: stretch;
  }

  .scope-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .scope-tabs button,
  .filter-tabs button {
    justify-content: center;
    min-width: 0;
    padding-inline: 8px;
    font-size: 13px;
  }

  .map-tools {
    left: 16px;
    top: 236px;
  }

  .system-dock {
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dock-card {
    grid-template-columns: 40px 1fr;
    gap: 8px;
  }

  .dock-card span {
    width: 38px;
    height: 38px;
  }

  .dock-card strong {
    font-size: 22px;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: relative;
    min-height: auto;
    padding: 14px 12px;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .brand-logo {
    width: 182px;
    height: 56px;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .topnav {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-wrap: wrap;
    gap: 8px 16px;
    overflow-x: visible;
    font-size: 13px;
    padding-bottom: 2px;
  }

  .topnav a {
    padding: 8px 0;
  }

  .top-actions {
    display: flex;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    gap: 8px;
  }

  .auth-top {
    width: 44px;
    max-width: 44px;
    padding: 0;
  }

  .auth-top span {
    display: none;
  }

  .primary-top {
    min-width: 92px;
    min-height: 44px;
    padding: 0 10px;
    font-size: 12px;
  }

  .primary-top svg {
    display: none;
  }

  .hero-copy {
    padding: 42px 18px 24px;
  }

  .map-stage {
    min-height: 700px;
  }

  .map-controls {
    flex-direction: column;
    inset: 14px 14px auto 14px;
    justify-content: flex-start;
    width: auto;
    gap: 10px;
  }

  .server-picker,
  .filter-tabs,
  .scope-tabs,
  .map-filter-stack {
    width: 100%;
  }

  .map-filter-stack {
    justify-items: stretch;
  }

  .filter-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-tabs button,
  .scope-tabs button {
    justify-content: center;
    padding: 0 8px;
    font-size: 13px;
  }

  .scope-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .server-menu {
    width: 100%;
    max-height: 238px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: auto;
  }

  .mini-server-menu {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-height: var(--mini-menu-max-height, 238px);
  }

  .map-tools {
    left: 14px;
    top: 244px;
  }

  .system-dock {
    left: 14px;
    right: 14px;
    bottom: 92px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-focus-card {
    left: 14px;
    right: 14px;
    bottom: 14px;
    width: auto;
  }

  .section {
    padding: 58px 16px;
  }

  .systems-grid,
  .help-grid,
  .field-grid,
  .compare-grid,
  .server-grid,
  .compare-assets,
  .terms-grid,
  .birthdays-grid,
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .result-top,
  .asset-row,
  .leader-row,
  .event-item {
    grid-template-columns: 1fr;
  }

  .asset-row,
  .event-item {
    gap: 8px;
  }

  .event-list-meta,
  .event-pager {
    flex-wrap: wrap;
  }

  .alerts-server-control {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .admin-status-cards {
    grid-template-columns: 1fr;
  }

  .auth-links,
  .admin-bot-row {
    grid-template-columns: 1fr;
  }

  .admin-bot-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-card {
    padding: 18px;
  }

  .auth-card h2 {
    font-size: 24px;
  }

  .worth,
  .asset-price,
  .event-time {
    white-space: normal;
  }
}

@media (max-width: 430px) {
  .topbar {
    padding: 12px 10px;
  }

  .brand-logo {
    width: 172px;
    height: 50px;
  }

  .primary-top {
    min-width: 82px;
    padding: 0 8px;
    font-size: 11px;
  }

  .hero-copy h1 {
    font-size: 32px;
  }

  .map-stage {
    min-height: 680px;
  }

  .dock-card {
    grid-template-columns: 38px 1fr;
    gap: 8px;
    min-height: 62px;
  }

  .dock-card span {
    width: 36px;
    height: 36px;
  }

  .dock-card strong {
    font-size: 22px;
  }

  .panel {
    padding: 18px;
  }

  .mode-tabs {
    grid-template-columns: 1fr;
  }
}

.mobile-tabbar {
  display: none;
}

@media (max-width: 980px) {
  .map-left-stack {
    width: min(520px, calc(100vw - 32px));
  }

  .status-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-search-panel {
    grid-template-columns: 22px minmax(0, 1fr) auto;
  }

  .compare-modern-grid,
  .online-head,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-status-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-details-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: 112px;
  }

  .topbar {
    position: sticky;
    grid-template-columns: 1fr;
  }

  .topnav {
    display: none;
  }

  .mobile-tabbar {
    position: fixed;
    z-index: 70;
    left: 10px;
    right: 10px;
    bottom: 10px;
    min-height: 58px;
    border-radius: 16px;
    padding: 7px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    background: rgba(23, 17, 29, 0.94);
    border: 1px solid var(--line-strong);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(18px);
  }

  .mobile-tabbar a {
    min-width: 0;
    border-radius: 12px;
    display: grid;
    place-items: center;
    gap: 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
  }

  .mobile-tabbar a.is-active {
    color: white;
    background: rgba(198, 44, 255, 0.22);
  }

  .mobile-tabbar svg {
    width: 18px;
    height: 18px;
  }

  .hero-map {
    min-height: calc(100vh - 76px);
  }

  .hero-copy {
    display: none;
  }

  .map-stage {
    min-height: calc(100vh - 76px);
    border-top-width: 1px;
  }

  .map-controls {
    inset: 12px 12px auto 12px;
    width: auto;
    max-height: calc(100vh - 180px);
    overflow: auto;
  }

  .map-left-stack {
    width: 100%;
  }

  .map-search-panel {
    grid-template-columns: 20px minmax(0, 1fr) 72px;
  }

  .status-tabs,
  .scope-tabs,
  .filter-tabs {
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.36);
  }

  .map-focus-card {
    left: 12px;
    right: 12px;
    bottom: 86px;
    width: auto;
    max-height: 44vh;
    overflow: auto;
  }

  .focus-detail-grid,
  .compare-stat-grid,
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .online-section {
    min-height: calc(100vh - 76px);
  }

  .online-chart-shell {
    min-height: 420px;
    height: clamp(420px, 58svh, 560px);
    display: grid;
    align-items: stretch;
  }

  .online-chart {
    width: 100%;
    height: 100%;
  }

  .section[data-page].is-active-page {
    padding-bottom: 136px;
  }

  .online-dashboard {
    width: min(100%, calc(100vw - 28px));
    padding: 16px;
  }

  .online-periods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .online-periods button {
    min-width: 0;
    padding: 0 10px;
    white-space: normal;
  }

  .result-top {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .result-top > div {
    min-width: 0;
  }

  .result-top h3 {
    font-size: clamp(24px, 9vw, 38px);
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  .worth {
    max-width: 100%;
    font-size: clamp(26px, 10vw, 42px);
    line-height: 1.08;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .asset-row {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .asset-row > div,
  .asset-row strong,
  .asset-row span,
  .asset-price {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .wide-action {
    min-height: 60px;
    padding: 10px 14px;
    line-height: 1.15;
    white-space: normal;
    text-align: center;
  }

  .compare-meter span {
    min-width: 8px;
  }
}

@media (hover: none), (pointer: coarse) {
  .map-tooltip {
    display: none;
  }
}

/* Final map layout overrides */
.map-stage {
  width: min(1180px, calc(100vw - 40px), calc(100svh - 178px));
  aspect-ratio: 1 / 1;
  min-height: 0;
  height: auto;
}

.map-tools {
  top: 170px;
  z-index: 18;
}

.map-controls {
  z-index: 42;
}

.server-picker {
  z-index: 60;
}

.server-menu {
  z-index: 90;
}

.system-dock {
  grid-template-columns: 1fr;
}

@media (max-width: 980px) {
  .map-stage {
    width: min(760px, calc(100vw - 28px), calc(100svh - 144px));
    min-height: 0;
  }

  .map-tools {
    top: 252px;
  }

  .system-dock {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 761px) and (max-height: 820px) {
  .map-controls {
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
  }

  .map-filter-stack {
    min-width: 0;
    justify-items: stretch;
  }

  .map-left-stack {
    width: 100%;
    min-width: 0;
  }

  .scope-tabs,
  .filter-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }

  .scope-tabs button,
  .filter-tabs button {
    justify-content: center;
    min-width: 0;
    padding: 0 8px;
  }
}

@media (max-width: 760px) {
  .map-stage {
    width: calc(100vw - 20px);
    min-height: 0;
  }

  .map-tools {
    top: 166px;
  }

  .system-dock {
    left: 12px;
    right: 12px;
    bottom: 74px;
    grid-template-columns: 1fr;
  }
}

/* Final mobile map composition */
@media (max-width: 760px) {
  main,
  .hero-map {
    overflow-x: clip;
  }

  .hero-map {
    min-height: auto;
    padding: 0 0 96px;
  }

  .map-stage {
    width: min(100%, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
    height: auto;
    min-height: 0;
    aspect-ratio: auto;
    padding: 10px;
    display: grid;
    grid-template-areas:
      "controls"
      "tools"
      "canvas"
      "focus"
      "stats";
    gap: 10px;
    overflow: visible;
    border-radius: 16px;
    background: rgba(12, 13, 20, 0.96);
  }

  .map-controls {
    position: relative;
    inset: auto;
    z-index: 5;
    grid-area: controls;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    max-height: none;
    overflow: visible;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    pointer-events: auto;
  }

  .map-left-stack,
  .server-picker,
  .map-filter-stack,
  .scope-tabs,
  .filter-tabs {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .server-picker-button,
  .map-search-panel {
    min-width: 0;
  }

  .map-left-stack {
    pointer-events: auto;
  }

  .map-search-panel {
    grid-template-columns: 20px minmax(0, 1fr) 72px 34px;
  }

  .map-search-panel button[type="submit"] {
    padding: 0 10px;
  }

  .server-menu {
    width: 100%;
    max-height: 210px;
  }

  .map-filter-stack {
    justify-items: stretch;
  }

  .scope-tabs,
  .filter-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 0;
  }

  .scope-tabs button,
  .filter-tabs button {
    justify-content: center;
    min-width: 0;
    padding: 0 8px;
    white-space: normal;
  }

  .map-tools {
    position: relative;
    grid-area: tools;
    left: auto;
    top: auto;
    z-index: 5;
    width: max-content;
    display: flex;
    gap: 6px;
  }

  .map-canvas {
    position: relative;
    grid-area: canvas;
    inset: auto;
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    border: 1px solid rgba(180, 92, 255, 0.22);
  }

  .map-focus-card {
    position: relative;
    grid-area: focus;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    max-height: none;
    overflow: visible;
  }

  .system-dock {
    position: relative;
    grid-area: stats;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 5;
    width: 100%;
    grid-template-columns: 1fr;
  }
}

@media (min-width: 560px) and (max-width: 760px) {
  .map-controls {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }

  .map-left-stack,
  .map-filter-stack {
    min-width: 0;
  }

  .scope-tabs,
  .filter-tabs {
    grid-template-columns: 1fr;
  }

  .map-tools {
    justify-self: start;
  }

  .system-dock {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
