:root {
  --radius: 12px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  --bg: #0e1116;
  --panel: #161a22;
  --muted: #a9b0c0;
  --line: #232836;
  --btn: #635bff;
  --btn-2: #1a2040;
  --text: #e6e6e6;
  --soft: #cfd4e6;
  --glass: rgba(255, 255, 255, 0.04);
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: start;
  padding: 24px 0 40px;
  background: radial-gradient(
      1200px 800px at 10% -10%,
      #1b2030 0%,
      transparent 60%
    ),
    var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial;
}
a {
  color: inherit;
}

.wrap {
  width: 100%;
  max-width: 1280px;
  padding: 0 16px;
}
h2 {
  font-weight: 800;
  letter-spacing: 0.2px;
  margin: 8px 0 16px;
}

.panel {
  background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.02),
      rgba(255, 255, 255, 0.01)
    ),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: saturate(120%) blur(2px);
}
.panel form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.panel input[type="url"] {
  flex: 1;
  min-width: 260px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #2a2f3e;
  background: #0e121a;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.panel input[type="url"]:focus {
  border-color: #404968;
  box-shadow: 0 0 0 4px rgba(99, 91, 255, 0.15);
}
.panel button {
  padding: 12px 16px;
  border-radius: 12px;
  border: 0;
  background: linear-gradient(90deg, var(--btn), #7f76ff);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s, filter 0.15s, box-shadow 0.15s;
  box-shadow: 0 8px 20px rgba(99, 91, 255, 0.25);
}
.panel button:hover {
  filter: brightness(1.05);
}
.panel button:active {
  transform: translateY(1px);
}
.panel button[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
  filter: saturate(0.5);
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.meta {
  margin: 14px 2px 8px;
  color: var(--muted);
  font-size: 14px;
}
.meta[aria-live] {
  min-height: 1.2em;
}

.tools-row {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 10px 2px 14px;
  flex-wrap: wrap;
}
.chk {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--soft);
}

.results {
  display: grid;
  gap: 12px;
}
.row-title {
  margin: 8px 2px 2px;
  color: #9fb0ff;
  font-size: 13px;
  letter-spacing: 0.2px;
}
.grid-top {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 992px) {
  .grid-top {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.list-vert {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
.list-vert:empty,
.grid-top:empty {
  display: none;
}

.card {
  background: linear-gradient(180deg, var(--glass), transparent), #0f1420;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 220px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  border-color: #2d3550;
}
.thumb {
  aspect-ratio: 16/9;
  width: 100%;
  background: #0b0f17;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.thumb video,
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.title {
  font-size: 13px;
  color: var(--soft);
  min-height: 2.2em;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.subtitle {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}
.actions {
  display: flex;
  gap: 8px;
}
.btn {
  flex: 1;
  text-align: center;
  border: 1px solid #2a2f3e;
  padding: 10px 12px;
  font-size: 12.5px;
  border-radius: 10px;
  color: #dbe0f4;
  background: var(--btn-2);
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover {
  background: #242b56;
  border-color: #39406a;
}
.btn.primary {
  background: linear-gradient(90deg, var(--btn), #7f76ff);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}
.btn.small {
  padding: 8px 10px;
  font-size: 12px;
}

.empty {
  color: #99a1b6;
  margin-top: 12px;
  text-align: center;
  padding: 10px 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: #1b2140;
  color: #e8ecff;
  border: 1px solid #2e3560;
  padding: 10px 14px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.toast.show {
  opacity: 1;
}
