:root {
  --bg: #0f1a1f;
  --card: #15252b;
  --text: #f4f7f8;
  --muted: #a8c0c7;
  --accent: #ffb457;
  --accent-2: #5bd6ff;
  --danger: #ff6b6b;
  --ok: #62d27c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 20% -10%, #233a45 0%, transparent 60%),
    radial-gradient(1000px 600px at 90% 0%, #1b2a2f 0%, transparent 55%),
    var(--bg);
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

main {
  width: min(980px, 100%);
  display: grid;
  gap: 24px;
}

header {
  display: grid;
  gap: 12px;
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 2vw + 1.4rem, 2.6rem);
  letter-spacing: -0.02em;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.grid {
  display: grid;
  gap: 20px;
}

.panel {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid #22343a;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.panel h2 {
  margin: 0 0 12px 0;
  font-size: 1.2rem;
}

.boxes {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.box {
  background: #0f2026;
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 8px;
  border: 1px solid #20343b;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.box strong {
  font-size: 0.95rem;
  color: var(--accent);
}

.value {
  font-size: 1.8rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

button {
  background: #1e323a;
  color: var(--text);
  border: 1px solid #2b4550;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.12s ease, background 0.2s ease;
}

button:hover {
  background: #28414c;
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.primary {
  background: linear-gradient(135deg, #ffb457, #ff7a59);
  color: #1c1410;
  border: none;
}

.secondary {
  background: linear-gradient(135deg, #5bd6ff, #3aa0ff);
  color: #0d1a22;
  border: none;
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
}

.status strong {
  color: var(--text);
}

.tag {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: #12242b;
  border: 1px solid #2a414b;
}

.tag.ok {
  color: var(--ok);
  border-color: rgba(98, 210, 124, 0.4);
}

.tag.warn {
  color: var(--danger);
  border-color: rgba(255, 107, 107, 0.4);
}

.targets {
  display: grid;
  gap: 10px;
}

.targets span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.rules {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
  color: var(--muted);
}

.panel-footer {
  margin-top: 16px;
}

.panel-footer[hidden] {
  display: none;
}

.tag#errorBox {
  white-space: pre-wrap;
}

.counter-panel {
  width: min(560px, 100%);
  margin-inline: auto;
}

.counter-panel .controls {
  justify-content: center;
}

.big-button {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.05rem;
  border-radius: 12px;
}

.counter {
  margin-top: 14px;
  display: grid;
  place-items: center;
  height: 140px;
  border-radius: 14px;
  background: #0f2026;
  border: 1px solid #20343b;
  font-size: clamp(3rem, 7vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.glow-ok {
  border-color: rgba(98, 210, 124, 0.6);
  box-shadow: 0 0 18px rgba(98, 210, 124, 0.55);
}

.glow-bad {
  border-color: rgba(255, 107, 107, 0.7);
  box-shadow: 0 0 18px rgba(255, 107, 107, 0.55);
}
