:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --border: rgba(59, 130, 246, 0.15);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --accent-dim: #60a5fa;
  --success: #10b981;
  --error: #ef4444;
  --radius: 12px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
}

a:hover {
  text-decoration: underline;
}

.wrap {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  background: var(--surface);
}

.logo {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.main {
  flex: 1;
  padding: 1.5rem 0 2.5rem;
}

.ad-slot {
  min-height: 90px;
  margin-bottom: 1.25rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.ad-inline {
  min-height: 250px;
  margin-top: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.hero {
  text-align: center;
  padding: 1.75rem 1.5rem;
}

.hero .label {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ip-display {
  margin: 0.5rem 0 0;
  font-size: clamp(1.25rem, 4vw, 1.85rem);
  font-weight: 700;
  font-family: ui-monospace, "Cascadia Code", monospace;
  word-break: break-all;
}

.ip-version {
  margin: 0.35rem 0 0;
  color: var(--accent);
  font-size: 0.9rem;
}

.status-msg {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.status-msg.error {
  color: var(--error);
}

.grid-two {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 720px) {
  .grid-two {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.info-grid {
  margin: 0;
}

.info-row {
  display: grid;
  grid-template-columns: minmax(0, 38%) 1fr;
  gap: 0.5rem 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.info-row dd {
  margin: 0;
  font-size: 0.95rem;
}

.map-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  background: #0a0e14;
}

.map-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.map-placeholder {
  margin: 0;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.hint {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.lookup-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.lookup-form input {
  flex: 1 1 200px;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

.lookup-form input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn {
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--muted);
}

.btn.primary {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: var(--accent);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ping-results {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

.ping-results.good {
  border-color: rgba(52, 211, 153, 0.35);
}

.site-footer {
  margin-top: auto;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
