:root {
  --bg: #07090c;
  --bg-2: #0c1015;
  --bg-3: #11161d;
  --fg: #d8e1ec;
  --fg-dim: #7d8a9c;
  --fg-muted: #4a5564;
  --accent: #6cf2c9;
  --accent-dim: #2c8d72;
  --warn: #f2c46c;
  --bad: #f26c8c;
  --good: #6cf2c9;
  --line: #1c232d;
  --line-2: #2a323e;
  --grade-pass: #6cf2c9;
  --grade-warn: #f2c46c;
  --grade-fail: #f26c8c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(108, 242, 201, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 242, 201, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 80%);
}

.hdr,
.main,
.footer {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px;
}

.hdr {
  padding-top: 48px;
  padding-bottom: 32px;
  text-align: center;
}

.brand {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--fg-dim);
  text-transform: uppercase;
  margin-bottom: 24px;
}

.brand-mark {
  color: var(--accent);
  font-weight: 700;
}

.brand-sep {
  margin: 0 10px;
  color: var(--fg-muted);
}

.title {
  font-size: clamp(28px, 5.5vw, 44px);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
  color: var(--fg);
  text-shadow: 0 0 22px rgba(108, 242, 201, 0.18);
}

.subtitle {
  font-size: 14px;
  color: var(--fg-dim);
  margin: 0;
  letter-spacing: 0.04em;
}

.input-card,
.result,
.info-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
}

.input-card::before,
.info-card::before,
.result::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px;
  width: 16px; height: 16px;
  border-top: 1px solid var(--accent);
  border-left: 1px solid var(--accent);
  border-top-left-radius: 6px;
}

.addr-label {
  display: block;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

.input-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#addr-input {
  flex: 1 1 380px;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  color: var(--fg);
  padding: 14px 16px;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#addr-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 18px rgba(108, 242, 201, 0.12);
}

#addr-input::placeholder { color: var(--fg-muted); }

.btn-primary,
.btn-secondary {
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.12em;
  font-weight: 700;
  padding: 14px 22px;
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
}

.btn-primary:hover { box-shadow: 0 0 24px rgba(108, 242, 201, 0.4); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  margin-top: 16px;
  padding: 10px 18px;
  width: 100%;
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: rgba(108, 242, 201, 0.06);
}

.status-line {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--fg-dim);
  min-height: 18px;
}

.status-line.err { color: var(--bad); }
.status-line.ok { color: var(--accent); }

.hidden { display: none !important; }

.score-block {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px dashed var(--line-2);
  margin-bottom: 24px;
}

@media (max-width: 640px) {
  .score-block {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .score-meta { text-align: left; }
}

.score-wheel {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
}

.score-svg {
  width: 200px;
  height: 200px;
  transform: none;
}

.ring-bg {
  fill: none;
  stroke: var(--line-2);
  stroke-width: 6;
}

.ring-fg {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.5, 0, 0.2, 1), stroke 0.3s;
  filter: drop-shadow(0 0 8px rgba(108, 242, 201, 0.4));
}

.ring-fg.warn { stroke: var(--warn); filter: drop-shadow(0 0 8px rgba(242, 196, 108, 0.4)); }
.ring-fg.bad { stroke: var(--bad); filter: drop-shadow(0 0 8px rgba(242, 108, 140, 0.4)); }

.score-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-weight: 700;
}

#score-value {
  font-size: 56px;
  letter-spacing: -0.02em;
  color: var(--fg);
  line-height: 1;
}

.score-of {
  font-size: 14px;
  color: var(--fg-dim);
  margin-top: 4px;
  letter-spacing: 0.05em;
}

.score-meta { font-size: 13px; }

.score-grade-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dotted var(--line);
}

.meta-row:last-of-type { border-bottom: none; }

.meta-label {
  color: var(--fg-dim);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.1em;
}

.meta-val {
  color: var(--fg);
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}

.mono-val { font-size: 11px; color: var(--fg-dim); }

.score-grade {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.score-grade.pass { color: var(--grade-pass); }
.score-grade.warn { color: var(--grade-warn); }
.score-grade.fail { color: var(--grade-fail); }

.checks-title,
.gaps-title,
.info-title {
  font-size: 13px;
  color: var(--accent);
  margin: 0 0 6px;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.checks-sub {
  font-size: 11px;
  color: var(--fg-muted);
  margin: 0 0 16px;
  letter-spacing: 0.05em;
}

.checks-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: check-counter;
}

.check-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 6px;
  background: var(--bg-3);
  align-items: start;
  counter-increment: check-counter;
}

.check-row::before {
  content: counter(check-counter, decimal-leading-zero);
  color: var(--fg-muted);
  font-size: 11px;
  padding-top: 2px;
}

.check-row.pass { border-left: 3px solid var(--good); }
.check-row.fail { border-left: 3px solid var(--bad); }

.check-label {
  font-size: 13px;
  color: var(--fg);
  font-weight: 500;
  margin-bottom: 4px;
}

.check-why {
  font-size: 12px;
  color: var(--fg-dim);
  line-height: 1.4;
}

.check-status {
  text-align: right;
  font-size: 11px;
  letter-spacing: 0.1em;
  font-weight: 700;
  padding-top: 2px;
  white-space: nowrap;
}

.check-status .points {
  display: block;
  color: var(--fg-muted);
  font-size: 10px;
  font-weight: 400;
  margin-top: 2px;
}

.check-row.pass .check-status { color: var(--good); }
.check-row.fail .check-status { color: var(--bad); }

.gaps-section {
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px dashed var(--line-2);
}

.gaps-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.gap-item {
  padding: 8px 12px;
  border-left: 2px solid var(--bad);
  background: rgba(242, 108, 140, 0.04);
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--fg);
  border-radius: 0 4px 4px 0;
}

.gap-item strong { color: var(--bad); }

.gaps-list .all-pass {
  border-left-color: var(--good);
  background: rgba(108, 242, 201, 0.05);
  color: var(--accent);
  font-weight: 500;
}

.info-card { margin-top: 32px; }

.info-card p {
  margin: 0 0 14px;
  color: var(--fg-dim);
  font-size: 13px;
  line-height: 1.65;
}

.dim-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.dim-pill {
  display: inline-block;
  font-size: 10px;
  padding: 4px 10px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--fg-dim);
  background: var(--bg-3);
  letter-spacing: 0.04em;
}

.footer {
  text-align: center;
  padding: 32px 24px 48px;
  color: var(--fg-muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.footer strong { color: var(--accent); font-weight: 500; }

@media (max-width: 480px) {
  .hdr { padding-top: 32px; }
  .input-row { flex-direction: column; }
  .btn-primary { width: 100%; }
  .check-row { grid-template-columns: 24px 1fr; }
  .check-status { grid-column: 2; text-align: left; padding-top: 6px; }
}
