:root {
  --bg: #000;
  --panel: #050805;
  --green: #00ff00;
  --green-dim: #00cc00;
  --green-faint: rgba(0, 255, 0, 0.08);
  --green-glow: rgba(0, 255, 0, 0.55);
  --border: rgba(0, 255, 0, 0.25);
  --border-strong: rgba(0, 255, 0, 0.7);
  --text: #e0e0e0;
  --bright: #fff;
  --muted: #9a9a9a;
  --error: #ff5f57;
  --error-faint: rgba(255, 95, 87, 0.08);
  --warning: #ffbd2e;
  --mono: ui-monospace, "Cascadia Code", "Fira Code", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  padding: 40px 16px;
  color: var(--text);
  font: 15px/1.6 var(--mono);
  background:
    repeating-linear-gradient(to bottom, rgba(0, 255, 0, 0.025) 0 1px, transparent 1px 4px),
    radial-gradient(ellipse at top, rgba(0, 255, 0, 0.06), transparent 60%),
    var(--bg);
}
::selection { background: var(--green); color: var(--bg); }

.card {
  --c: var(--green);
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 32px 20px;
  background:
    linear-gradient(var(--c), var(--c)) top left / 14px 2px,
    linear-gradient(var(--c), var(--c)) top left / 2px 14px,
    linear-gradient(var(--c), var(--c)) top right / 14px 2px,
    linear-gradient(var(--c), var(--c)) top right / 2px 14px,
    linear-gradient(var(--c), var(--c)) bottom left / 14px 2px,
    linear-gradient(var(--c), var(--c)) bottom left / 2px 14px,
    linear-gradient(var(--c), var(--c)) bottom right / 14px 2px,
    linear-gradient(var(--c), var(--c)) bottom right / 2px 14px,
    var(--panel);
  background-repeat: no-repeat;
  outline: 1px solid var(--border);
  outline-offset: -1px;
}

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.prompt { color: var(--green); font-weight: 700; }
h1 {
  margin: 28px 0 0;
  color: var(--green);
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 0 12px var(--green-glow), 0 0 32px rgba(0, 255, 0, 0.25);
}
.subtitle { margin: 10px 0 28px; color: var(--muted); }
.subtitle::before { content: "// "; color: var(--green-dim); }

a { color: var(--green); }
.donate {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
  text-transform: lowercase;
  transition: background .15s, color .15s, box-shadow .15s;
}
.donate:hover { background: var(--green); color: var(--bg); box-shadow: 0 0 16px var(--green-glow); }

.btn, .icon-btn {
  min-height: 44px;
  font: inherit;
  font-weight: 700;
  border-radius: 0;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s, border-color .15s;
}
.btn { padding: 8px 20px; text-transform: lowercase; border: 1px solid var(--green); }
.btn-primary { background: var(--green); color: var(--bg); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 0 18px var(--green-glow); }
.btn-secondary { background: transparent; color: var(--green); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--green-faint); border-color: var(--green); }
button:disabled { opacity: .35; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

.dropzone {
  border: 1px dashed var(--border-strong);
  padding: 36px 16px;
  text-align: center;
  transition: background .15s, box-shadow .15s, border-color .15s;
}
.dropzone.slim { padding: 12px 16px; }
.dropzone.over { border-style: solid; border-color: var(--green); background: var(--green-faint); box-shadow: inset 0 0 24px rgba(0, 255, 0, 0.15); }
.drop-full p { margin: 0 0 10px; }
.drop-title { color: var(--bright); font-size: 1.15rem; font-weight: 700; }
.drop-or { color: var(--muted); }
.drop-slim { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; color: var(--muted); }

.empty, .order-hint { margin: 22px 0 10px; color: var(--muted); }
.empty::before, .order-hint::before { content: "# "; color: var(--green-dim); }
.file-list { list-style: none; margin: 0; padding: 0; }

.file {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  background: rgba(0, 255, 0, 0.02);
  transition: border-color .15s, background .15s;
}
.file:hover { border-color: var(--border-strong); border-left-color: var(--green); background: var(--green-faint); }
.file.reading { border-left-color: var(--muted); }
.file.error { border-color: rgba(255, 95, 87, 0.45); border-left-color: var(--error); background: var(--error-faint); }
.pos { min-width: 2ch; color: var(--green); font-weight: 700; }
.file.error .pos { color: var(--error); }
.info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.name { color: var(--bright); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { font-size: .85rem; color: var(--muted); }
.error-msg { font-size: .85rem; color: var(--error); }
.controls { display: flex; gap: 4px; }
.icon-btn {
  min-width: 44px;
  background: transparent;
  color: var(--green);
  border: 1px solid var(--border);
  font-size: 1.05rem;
}
.icon-btn:hover:not(:disabled) { border-color: var(--green); background: var(--green-faint); }
.icon-btn.remove:hover:not(:disabled) { color: var(--error); border-color: var(--error); background: var(--error-faint); }

.warning { color: var(--warning); font-weight: 700; }
.warning::before { content: "! "; }
.status { min-height: 1.6em; margin: 18px 0 0; color: var(--green); font-weight: 700; }
.status::before { content: "> "; color: var(--green-dim); }
.status:empty::after { content: "ready_"; color: var(--muted); font-weight: 400; }
.download-wrap { margin: 4px 0 0; }
.download-wrap::before { content: "  ↳ "; white-space: pre; color: var(--green-dim); }
.link { font-weight: 700; }

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.field { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.field input {
  min-height: 44px;
  width: 15rem;
  padding: 8px 12px;
  font: inherit;
  color: var(--green);
  caret-color: var(--green);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 0;
}
.field input:focus-visible { outline-offset: 0; box-shadow: 0 0 12px rgba(0, 255, 0, 0.3); }
.actions { display: flex; gap: 8px; }
.hint { width: 100%; margin: 0; color: var(--muted); font-size: .85rem; text-align: right; }

.sig { margin: 20px 0 0; text-align: right; font-size: .85rem; }
.sig a { color: var(--bright); font-weight: 700; text-decoration: none; }
.sig a:hover { color: var(--green); }

.busy::before {
  content: "";
  display: inline-block;
  width: .9em;
  height: .9em;
  margin-right: 8px;
  vertical-align: -1px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.busy:disabled { opacity: 1; cursor: progress; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before { transition: none !important; animation-duration: 2s !important; }
}

@media (max-width: 600px) {
  body { padding: 16px; font-size: 14px; }
  .card { padding: 20px 16px 16px; }
  h1 { margin-top: 20px; }
  .file { flex-wrap: wrap; }
  .info { flex-basis: calc(100% - 4ch); }
  .controls { margin-left: auto; }
  .footer, .field, .actions { flex-direction: column; align-items: stretch; width: 100%; }
  .field input { width: 100%; }
  .actions { flex-direction: column-reverse; }
  .btn { width: 100%; }
  .hint { text-align: left; }
}
