@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: dark;
  --panel: rgba(24, 24, 27, 0.76);
  --panel-strong: rgba(39, 39, 42, 0.82);
  --line: rgba(255, 255, 255, 0.1);
  --text-muted: rgb(161, 161, 170);
  --accent: rgb(16, 185, 129);
  --accent-2: rgb(56, 189, 248);
  --warning: rgb(245, 158, 11);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 70% 6%, rgba(37, 99, 235, 0.22), transparent 26rem),
    radial-gradient(circle at 14% 12%, rgba(20, 184, 166, 0.16), transparent 32rem),
    linear-gradient(135deg, rgb(4, 10, 32) 0%, rgb(3, 11, 28) 45%, rgb(5, 18, 24) 100%);
  color: rgb(244, 244, 245);
}

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

.glass-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(18px);
}

.soft-panel {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.data-card {
  min-height: 8.5rem;
  background: rgba(39, 39, 42, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.data-card:hover {
  transform: translateY(-2px);
  border-color: rgba(16, 185, 129, 0.38);
  background: rgba(45, 45, 49, 0.86);
}

.data-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.data-value {
  margin-top: 0.7rem;
  color: white;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.data-note {
  margin-top: 0.55rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  padding: 0.75rem 0.9rem;
  color: rgb(212, 212, 216);
  font-size: 0.875rem;
  line-height: 1.5;
}

.mini-dot {
  width: 0.55rem;
  height: 0.55rem;
  flex: none;
  border-radius: 999px;
  background: rgb(113, 113, 122);
}

.mini-dot.ok {
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.12);
}

.mini-dot.warn {
  background: var(--warning);
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.12);
}

.mini-dot.fail {
  background: rgb(244, 63, 94);
  box-shadow: 0 0 0 5px rgba(244, 63, 94, 0.12);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: rgb(244, 244, 245);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.2);
}

.icon-button:active {
  transform: scale(0.96);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 3.5rem;
  border-radius: 8px;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.primary-button {
  background: rgb(250, 250, 250);
  color: rgb(9, 9, 11);
}

.primary-button:hover {
  background: var(--accent);
  color: white;
}

.secondary-button {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.42);
  color: rgb(252, 211, 77);
}

.secondary-button:hover {
  background: rgba(245, 158, 11, 0.25);
  color: white;
}

.primary-button:active,
.secondary-button:active {
  transform: scale(0.98);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.icon-button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

.metric-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.metric-row:last-child {
  border-bottom: 0;
}

.metric-label {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.metric-value {
  max-width: 62%;
  text-align: right;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.13);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  color: rgb(212, 212, 216);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.language-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  color: rgb(212, 212, 216);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.language-button:hover,
.language-button[aria-pressed="true"] {
  border-color: rgba(16, 185, 129, 0.48);
  background: rgba(16, 185, 129, 0.14);
  color: white;
}

.language-dropdown {
  position: relative;
  z-index: 20;
}

.language-trigger,
.language-option {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: rgb(226, 232, 240);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 800;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.language-trigger {
  min-width: 7.5rem;
  justify-content: center;
  padding: 0.65rem 0.85rem;
}

.language-trigger:hover,
.language-dropdown[data-open="true"] .language-trigger {
  border-color: rgba(16, 185, 129, 0.48);
  background: rgba(16, 185, 129, 0.14);
  color: white;
}

.language-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.6rem);
  display: none;
  width: min(18rem, calc(100vw - 2rem));
  max-height: 21rem;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(9, 12, 26, 0.98);
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.35);
  padding: 0.45rem;
}

.language-dropdown[data-open="true"] .language-menu {
  display: grid;
  gap: 0.35rem;
}

.language-option {
  width: 100%;
  justify-content: flex-start;
  padding: 0.65rem 0.75rem;
  text-align: left;
}

.language-option small {
  margin-left: auto;
  color: rgb(113, 113, 122);
  font-size: 0.72rem;
}

.language-option:hover,
.language-option[aria-selected="true"] {
  border-color: rgba(56, 189, 248, 0.42);
  background: rgba(56, 189, 248, 0.13);
  color: white;
}

.footer-link {
  text-decoration: none;
  transition: color 160ms ease;
}

.footer-link:hover {
  color: rgb(110, 231, 183);
}

.ip-hero {
  position: relative;
  overflow: hidden;
}

.ip-hero::before {
  position: absolute;
  inset: auto -12% 0;
  height: 52%;
  content: "";
  pointer-events: none;
  opacity: 0.6;
  background:
    linear-gradient(115deg, transparent 0 12%, rgba(14, 165, 233, 0.22) 12.2% 12.7%, transparent 13% 38%, rgba(59, 130, 246, 0.2) 38.3% 38.8%, transparent 39%),
    linear-gradient(65deg, transparent 0 18%, rgba(20, 184, 166, 0.16) 18.2% 18.7%, transparent 19% 55%, rgba(37, 99, 235, 0.18) 55.2% 55.7%, transparent 56%),
    repeating-linear-gradient(90deg, transparent 0 4.75rem, rgba(59, 130, 246, 0.14) 4.8rem 4.9rem, transparent 5rem);
  mask-image: linear-gradient(to top, black 25%, transparent 100%);
}

.ip-hero > * {
  position: relative;
  z-index: 1;
}

.hero-ip-title {
  color: white;
  font-size: clamp(2.4rem, 7vw, 5.6rem);
  font-weight: 800;
  line-height: 1;
}

.hero-ip-title .font-mono {
  overflow-wrap: anywhere;
}

.country-dot {
  width: 1.8rem;
  height: 1.8rem;
  border: 5px solid white;
  border-radius: 999px;
  background: rgb(220, 38, 38);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.country-dot.empty {
  border-width: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.hero-restart-button {
  display: inline-flex;
  min-height: 2.65rem;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  padding: 0 1.1rem;
  color: white;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.hero-restart-button:hover {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.16);
}

.hero-restart-button:active {
  transform: scale(0.98);
}

.whoer-card,
.detection-pill,
.score-panel {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  background: rgba(2, 8, 28, 0.74);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

.whoer-card {
  display: grid;
  min-height: 5.9rem;
  grid-template-columns: auto minmax(5rem, 0.42fr) 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1.3rem 1.5rem;
  text-align: left;
}

.whoer-card-label {
  color: rgb(226, 232, 240);
  font-weight: 600;
}

.whoer-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: white;
  font-size: 1.05rem;
}

.detection-pill {
  display: grid;
  min-height: 4rem;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  text-align: left;
}

.detection-pill span:first-child {
  color: rgb(226, 232, 240);
  font-weight: 600;
}

.detection-pill strong {
  color: white;
  font-size: 0.98rem;
}

.check-badge {
  display: inline-flex;
  width: 1.75rem;
  height: 1.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.22);
  color: rgb(203, 213, 225);
}

.check-badge.ok {
  background: rgb(22, 163, 74);
  color: white;
}

.check-badge.warn {
  background: rgb(245, 158, 11);
  color: rgb(24, 24, 27);
}

.score-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  text-align: left;
}

.score-number {
  display: flex;
  flex: none;
  align-items: baseline;
  gap: 0.35rem;
  color: rgb(52, 211, 153);
  font-weight: 800;
}

.score-number span {
  font-size: clamp(2.7rem, 6vw, 4.6rem);
  line-height: 1;
}

.score-number small {
  color: rgb(148, 163, 184);
  font-size: 0.95rem;
}

.chart-shell {
  position: relative;
  min-height: 21rem;
}

.detail-table {
  display: grid;
  overflow: hidden;
  border-radius: 8px;
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(9rem, 0.28fr) 1fr;
  min-height: 3.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-label,
.detail-value {
  display: flex;
  align-items: center;
  padding: 0.85rem 1rem;
  overflow-wrap: anywhere;
}

.detail-label {
  justify-content: center;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: rgb(203, 213, 225);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

.detail-value {
  color: white;
  font-weight: 650;
}

.value-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  color: white;
  font-size: 0.85rem;
  font-weight: 800;
}

.value-badge.ok {
  background: rgba(16, 185, 129, 0.82);
}

.value-badge.warn {
  background: rgba(245, 158, 11, 0.88);
}

.value-badge.fail {
  background: rgba(244, 63, 94, 0.88);
}

.risk-meter {
  display: flex;
  width: min(100%, 26rem);
  align-items: center;
  gap: 0.65rem;
}

.risk-meter-track {
  display: block;
  height: 0.75rem;
  flex: 1;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.risk-meter-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.risk-meter-track .ok {
  background: rgb(34, 197, 94);
}

.risk-meter-track .warn {
  background: rgb(234, 179, 8);
}

.risk-meter-track .fail {
  background: rgb(239, 68, 68);
}

.risk-meter strong {
  min-width: 3.2rem;
  text-align: right;
}

.risk-meter em {
  color: rgb(161, 161, 170);
  font-size: 0.82rem;
  font-style: normal;
}

.map-panel {
  min-height: 19rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.map-fallback {
  display: grid;
  min-height: 19rem;
  place-items: center;
  padding: 1.5rem;
  color: rgb(161, 161, 170);
  text-align: center;
}

.leaflet-container {
  background: rgb(15, 23, 42);
  color: rgb(24, 24, 27);
  font-family: "Inter", system-ui, sans-serif;
}

.policy-page {
  max-width: 58rem;
}

.policy-section {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}

.policy-section h2 {
  color: white;
  font-size: 1.35rem;
  font-weight: 800;
}

.policy-section p {
  margin-top: 0.75rem;
  color: rgb(180, 180, 190);
  line-height: 1.75;
}

@media (max-width: 640px) {
  .metric-row {
    align-items: stretch;
    flex-direction: column;
    gap: 0.35rem;
  }

  .metric-value {
    max-width: 100%;
    text-align: left;
  }

  .chart-shell {
    min-height: 18rem;
  }

  .whoer-card {
    grid-template-columns: auto 1fr;
  }

  .whoer-card strong {
    grid-column: 1 / -1;
  }

  .score-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-row {
    grid-template-columns: 1fr;
  }

  .detail-label {
    justify-content: flex-start;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
  }

  .risk-meter {
    align-items: flex-start;
    flex-direction: column;
  }

  .language-menu {
    right: auto;
    left: 0;
  }
}
  
