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

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f5f5f8;
  --surface: #ffffff;
  --surface2: #eeeef3;
  --border: #dddde5;
  --text: #1a1a2e;
  --text-dim: #6b6b80;
  --accent: #6366f1;
  --accent2: #a855f7;
  --gold: #d97706;
  --green: #059669;
  --red: #dc2626;
  --blue: #2563eb;
  --shadow: rgba(0, 0, 0, 0.06);
  --card-hover-shadow: rgba(99, 102, 241, 0.1);
  --badge-bg: rgba(99, 102, 241, 0.08);
  --badge-border: rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface2: #1a1a26;
  --border: #2a2a3a;
  --text: #e8e8f0;
  --text-dim: #8888a0;
  --accent: #818cf8;
  --accent2: #c084fc;
  --gold: #fbbf24;
  --green: #34d399;
  --red: #f87171;
  --blue: #60a5fa;
  --shadow: rgba(0, 0, 0, 0.3);
  --card-hover-shadow: rgba(99, 102, 241, 0.15);
  --badge-bg: rgba(99, 102, 241, 0.12);
  --badge-border: rgba(129, 140, 248, 0.3);
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition:
    background 0.4s,
    color 0.4s;
}

.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px var(--shadow);
  transition: all 0.3s;
}

.theme-toggle:hover {
  transform: scale(1.1);
  border-color: var(--accent);
}

.layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1.5rem;
}

.top a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}

.top a:hover {
  opacity: 0.75;
}

h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 1.5rem 0 1rem;
}

.lead {
  color: var(--text-dim);
  max-width: 66ch;
  margin-bottom: 1.5rem;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.6;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 2px 12px var(--shadow);
  transition: all 0.3s;
}

.card:hover {
  box-shadow: 0 8px 32px var(--card-hover-shadow);
}

button {
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  padding: 0.65rem 1.1rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  transition: all 0.2s;
}

button:hover {
  border-color: var(--accent);
}

button.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
}

button.primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1.2rem;
}

.bar-block {
  margin-bottom: 0.6rem;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.22rem;
}

.bar-track {
  width: 100%;
  height: 7px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 999px;
}

.pill {
  border: 1px solid var(--border);
  color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.26rem 0.48rem;
  white-space: nowrap;
}

.label-group {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.6rem;
}

.label-box {
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
}

.label-box.good {
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid rgba(5, 150, 105, 0.25);
}

.label-box.bad {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.label-box h3 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}

.label-box ul {
  margin-left: 1rem;
  display: grid;
  gap: 0.25rem;
}

.label-box li {
  font-size: 0.8rem;
  line-height: 1.35;
}

footer {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-dim);
  font-size: 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

footer .brand {
  font-size: 1.1rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.4rem;
}

.sub {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-top: 0.2rem;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem;
  box-shadow: 0 2px 10px var(--shadow);
}

.stat .k {
  color: var(--text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat .v {
  margin-top: 0.2rem;
  font-weight: 800;
  font-size: 1.2rem;
}

.control {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.control label {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.control input,
.control select {
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 0.7rem 0.8rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.control input:focus,
.control select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

@media (max-width: 920px) {
  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .stats-strip {
    grid-template-columns: 1fr;
  }
}
