:root {
  --bg-top: #050507;
  --bg-mid: #120c1a;
  --bg-bottom: #4d2b72;
  --panel: rgba(12, 12, 14, 0.72);
  --line: rgba(255, 255, 255, 0.18);
  --text: #f3f2f7;
  --muted: #b9b5c8;
  --accent: #a877cf;
  --accent-2: #855bb2;
  --ok: #7ce8b8;
  --danger: #ff7c7c;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Trebuchet MS", "Verdana", sans-serif;
  color: var(--text);
  background: #000;
  overflow-x: hidden;
}

.backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(80% 60% at 80% 80%, rgba(130, 92, 184, 0.14), transparent),
    linear-gradient(to top, var(--bg-bottom) 0%, var(--bg-mid) 45%, var(--bg-top) 100%);
  animation: slowShift 16s linear infinite alternate;
  z-index: -1;
}

@keyframes slowShift {
  from {
    filter: hue-rotate(0deg) saturate(1);
    transform: scale(1);
  }

  to {
    filter: hue-rotate(18deg) saturate(1.08);
    transform: scale(1.04);
  }
}

.shell {
  width: min(900px, 100% - 2rem);
  margin: 2.2rem auto;
  display: grid;
  gap: 1rem;
}

.hero {
  padding: 1rem 0.1rem;
}

.eyebrow {
  margin: 0;
  font-size: 0.73rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

h1 {
  margin: 0.45rem 0;
  line-height: 1.1;
  font-size: clamp(1.5rem, 2vw + 1rem, 2.4rem);
}

.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 62ch;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  padding: 1rem;
}

.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.32);
  border-radius: 16px;
  padding: 2rem 1rem;
  text-align: center;
  transition:
    border-color 140ms ease,
    transform 140ms ease,
    background 140ms ease,
    box-shadow 160ms ease;
  outline: none;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.drag {
  border-color: var(--accent);
  background: rgba(168, 119, 207, 0.06);
  transform: translateY(-1px);
}

.dropzone.drag-ok {
  border-color: var(--ok);
  background:
    radial-gradient(circle at 20% 20%, rgba(124, 232, 184, 0.18), transparent 48%),
    rgba(124, 232, 184, 0.08);
  box-shadow: 0 0 0 2px rgba(124, 232, 184, 0.2), 0 14px 36px rgba(124, 232, 184, 0.14);
}

.dropzone.drop-flash {
  animation: dropFlash 420ms ease;
}

.dropzone.drag-bad {
  border-color: var(--danger);
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 124, 124, 0.2), transparent 50%),
    rgba(255, 124, 124, 0.08);
  box-shadow: 0 0 0 2px rgba(255, 124, 124, 0.18);
  animation: badPulse 380ms ease;
}

@keyframes dropFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(124, 232, 184, 0.45);
  }

  100% {
    box-shadow: 0 0 0 14px rgba(124, 232, 184, 0);
  }
}

@keyframes badPulse {
  0% {
    transform: translateY(0);
  }

  35% {
    transform: translateY(-1px) translateX(-1px);
  }

  70% {
    transform: translateY(-1px) translateX(1px);
  }

  100% {
    transform: translateY(-1px);
  }
}

.dropzone-title {
  margin: 0 0 0.3rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.dropzone.drag-ok .dropzone-title {
  color: var(--ok);
}

.dropzone.drag-bad .dropzone-title {
  color: var(--danger);
}

.dropzone-hint,
.dropzone-meta {
  margin: 0.4rem 0;
  color: var(--muted);
}

.picker-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.preview {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.8rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem;
}

.preview.animate-in,
.result.animate-in {
  animation: panelIn 280ms cubic-bezier(0.21, 0.97, 0.36, 1);
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(7px) scale(0.99);
    filter: blur(2px);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.preview img,
.viewer-gif {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
  background: #000;
}

.preview-info p,
.viewer-meta,
.result-stats {
  margin: 0.2rem 0;
  color: var(--muted);
}

.actions {
  margin-top: 1rem;
}

.btn {
  border: 0;
  border-radius: 10px;
  background: linear-gradient(130deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.72rem 1rem;
  transition: transform 120ms ease, opacity 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn.ghost,
.link-btn {
  background: transparent;
  border: 1px solid var(--line);
}

.status {
  min-height: 1.4rem;
  margin-top: 0.65rem;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
}

.status.ok {
  color: var(--ok);
}

.result {
  margin-top: 0.8rem;
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
}

.listing {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.95rem;
}

.listing-head {
  margin-bottom: 0.35rem;
}

.listing-status {
  margin: 0 0 0.5rem;
  min-height: 1.2rem;
  color: var(--muted);
}

.listing-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.listing-item {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    rgba(8, 8, 10, 0.42);
  padding: 0.62rem 0.72rem;
  display: grid;
  gap: 0.15rem;
  transition: border-color 140ms ease, background 140ms ease;
}

.listing-item:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01)),
    rgba(10, 10, 13, 0.52);
}

.listing-link {
  display: inline-block;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 0.1rem;
  text-decoration: none;
}

.listing-link:hover {
  text-decoration: underline;
}

.listing-name,
.listing-meta {
  color: var(--muted);
  font-size: 0.86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.admin-cards {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  padding: 0.65rem;
}

.admin-card-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.admin-card-value {
  margin: 0.38rem 0 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.admin-recent-wrap {
  margin-top: 1rem;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.55rem 0.6rem;
  font-size: 0.9rem;
}

.admin-table th {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
}

.result-label,
.viewer-label {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.link-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
}

input[readonly] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.38);
  color: var(--text);
  padding: 0.68rem;
}

.viewer-gif {
  max-height: 70vh;
  object-fit: contain;
}

.link-btn {
  display: inline-block;
  margin-top: 0.8rem;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

@media (max-width: 620px) {
  .shell {
    width: min(900px, 100% - 1rem);
    margin: 1rem auto;
  }

  .preview {
    grid-template-columns: 1fr;
  }

  .link-row {
    grid-template-columns: 1fr;
  }

  .admin-cards {
    grid-template-columns: 1fr;
  }

  .picker-row .btn {
    width: 100%;
  }
}
