:root {
  --bg: #0f1724;
  --card: #0b1220;
  --muted: #9ca3af;
  --accent: #2dd4bf;
  --glass: rgba(255, 255, 255, 0.03);
  --glass-2: rgba(255, 255, 255, 0.02);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, system-ui, Segoe UI, Roboto, Arial;
  background: linear-gradient(180deg, var(--bg), #071223 120%);
  color: #e6eef6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 36px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.wrap {
  width: 100%;
  max-width: 980px;
}

header.site-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.logo {
  width: 130px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #60a5fa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #042027;
  font-size: 22px;
  box-shadow: 0 6px 20px rgba(2, 6, 23, 0.6);
}

.site-title {
  line-height: 1;
}

.site-title h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.site-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

main.card {
  background: linear-gradient(180deg, var(--card), rgba(11, 18, 32, 0.8));
  padding: 22px;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(2, 6, 23, 0.6);
}

.hero {
  display: flex;
  gap: 24px;
  align-items: center;
}

.left {
  flex: 1;
}

.right {
  width: 340px;
}

.headline {
  font-size: 20px;
  margin: 0 0 6px 0;
}

.sub {
  color: var(--muted);
  margin: 0 0 12px 0;
}

.controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

button.primary {
  background: linear-gradient(90deg, var(--accent), #60a5fa);
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  color: #042027;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(45, 212, 191, 0.12);
}

button.primary:disabled {
  opacity: 0.5;
  cursor: default;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.stat-block {
  background: var(--glass);
  padding: 12px;
  border-radius: 10px;
}

.stat-block strong {
  display: block;
  font-size: 18px;
}

.stat-block .muted {
  color: var(--muted);
  font-size: 13px;
}

.meter {
  height: 12px;
  background: var(--glass-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.meter > .bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #60a5fa);
  transition: width 0.2s;
}

pre#log {
  background: transparent;
  border: none;
  color: var(--muted);
  margin-top: 14px;
  white-space: pre-wrap;
  max-height: 6.5em;   /* ~5 lines (depending on font-size/line-height) */
  overflow-y: auto;    /* adds scroll if more lines */
}

/* Scrollbar styling (WebKit browsers like Chrome, Edge, Safari) */
#log::-webkit-scrollbar {
  width: 6px;
}

#log::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05); /* subtle track */
  border-radius: 10px;
}

#log::-webkit-scrollbar-thumb {
  background: var(--accent); /* teal thumb */
  border-radius: 10px;
}

#log::-webkit-scrollbar-thumb:hover {
  background: #22c1a6; /* slightly brighter on hover */
}

/* Firefox scrollbar */
#log {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) rgba(255, 255, 255, 0.05);
}

footer.small {
  color: var(--muted);
  font-size: 13px;
  margin-top: 14px;
  text-align: center;
}

.img {
  width: 110px;
  filter: brightness(0) invert(1);
}

@media (max-width: 880px) {
  .hero {
    flex-direction: column;
  }
  .right {
    width: 100%;
  }
  .stats {
    grid-template-columns: repeat(1, 1fr);
  }
}
