:root {
  color-scheme: dark;
  --bg: #08080d;
  --panel: #11111a;
  --panel-2: #171722;
  --ink: #f7f3ff;
  --muted: #a8a1b8;
  --line: #2b2638;
  --accent: #8500b9;
  --accent-dark: #6b0098;
  --danger: #ff5c7a;
  --ok: #30d992;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Tahoma, sans-serif;
  background:
    radial-gradient(circle at top, rgba(133, 0, 185, 0.22), transparent 34rem),
    linear-gradient(145deg, #07070c 0%, #101018 52%, #08080d 100%);
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 28px;
}

.shell {
  width: min(980px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 32px 22px;
  border-bottom: 1px solid var(--line);
  background: #050507;
}

.logo {
  display: block;
  width: min(280px, 70vw);
  height: auto;
}

.workspace {
  padding: 30px 32px 34px;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
}

h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}

.drop {
  display: grid;
  gap: 16px;
  place-items: center;
  min-height: 230px;
  border: 1px dashed rgba(133, 0, 185, 0.72);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(133, 0, 185, 0.11), rgba(255, 255, 255, 0.025));
  padding: 28px;
  text-align: center;
}

input[type="file"] {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #0b0b12;
  color: var(--ink);
}

input[type="file"]::file-selector-button {
  border: 0;
  border-radius: 5px;
  background: #262033;
  color: var(--ink);
  padding: 9px 12px;
  margin-inline-end: 12px;
  cursor: pointer;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, #a900e8, var(--accent));
  color: white;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(133, 0, 185, 0.28);
}

button:hover,
.button:hover {
  background: var(--accent-dark);
}

button[disabled] {
  opacity: 0.7;
  cursor: wait;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel-2);
}

.stat strong {
  display: block;
  font-size: 30px;
  margin-bottom: 4px;
}

.live strong {
  color: var(--ok);
}

.dead strong {
  color: var(--danger);
}

.results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.result-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-2);
}

.result-box h2 {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #0c0c13;
}

pre {
  min-height: 180px;
  max-height: 360px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #ebe6f6;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.error {
  border: 1px solid #fecdca;
  background: #fffbfa;
  color: #912018;
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 18px;
}

.loading {
  display: none;
  margin-top: 18px;
  border: 1px solid rgba(133, 0, 185, 0.5);
  background: rgba(133, 0, 185, 0.14);
  color: #e9d7ff;
  padding: 14px 16px;
  border-radius: 8px;
  line-height: 1.7;
}

.loading.active {
  display: block;
}

.hidden {
  display: none;
}

@media (max-width: 640px) {
  body {
    padding: 14px;
  }

  .brand,
  .workspace {
    padding-left: 18px;
    padding-right: 18px;
  }

  .stats,
  .results {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }
}
