:root {
  --bg: #f6f7f8;
  --panel: #ffffff;
  --ink: #16181d;
  --muted: #667085;
  --line: #dde3ea;
  --soft: #eef6f4;
  --accent: #087f8c;
  --accent-dark: #075e68;
  --warn: #b45309;
  --bad: #b91c1c;
  --good: #15803d;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

.landing-body {
  min-height: 100vh;
  background: #060407;
}

.landing-shell {
  display: grid;
  min-height: 100vh;
  align-items: end;
  justify-items: end;
  padding: clamp(16px, 4vw, 42px);
  background:
    linear-gradient(180deg, rgb(0 0 0 / 0%) 0%, rgb(0 0 0 / 0%) 54%, rgb(0 0 0 / 52%) 100%),
    var(--landing-art) center / contain no-repeat;
}

.landing-hero {
  width: fit-content;
  padding: 0;
  color: white;
}

.landing-kicker {
  color: #d9b8ff;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.landing-hero h1 {
  margin-top: 8px;
  font-size: clamp(40px, 8vw, 82px);
  line-height: 0.95;
  text-shadow: 0 8px 34px rgb(0 0 0 / 70%);
}

.landing-copy {
  max-width: 560px;
  margin-top: 18px;
  color: #3f4b54;
  font-size: clamp(18px, 3vw, 24px);
  line-height: 1.35;
}

.landing-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(132px, 1fr));
  gap: 10px;
  width: min(340px, calc(100vw - 32px));
}

.landing-card {
  display: grid;
  min-height: 64px;
  place-items: center;
  padding: 14px 16px;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 8px;
  background: rgb(9 6 12 / 82%);
  color: white;
  text-decoration: none;
  box-shadow: 0 14px 34px rgb(0 0 0 / 34%);
  backdrop-filter: blur(10px);
}

.landing-card.primary {
  background: rgb(96 31 139 / 86%);
  color: white;
  border-color: rgb(217 184 255 / 45%);
}

.landing-card span {
  color: inherit;
  font-size: 13px;
  font-weight: 800;
  opacity: 0.75;
  text-transform: uppercase;
}

.landing-card strong {
  font-size: clamp(18px, 3vw, 24px);
  line-height: 1;
}

body.splash-open {
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 30px clamp(16px, 4vw, 28px) 18px;
  border-bottom: 1px solid var(--line);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
}

.topbar p {
  margin-top: 4px;
  color: var(--muted);
}

.status-pill {
  min-width: 112px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.status-pill.ok {
  color: var(--good);
  border-color: #b8dec2;
}

.status-pill.bad {
  color: var(--bad);
  border-color: #efb6b6;
}

.layout {
  display: grid;
  gap: 18px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 18px clamp(16px, 4vw, 28px) 36px;
}

.search-zone,
.downloads-panel,
.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgb(16 24 40 / 7%);
}
.view-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  width: fit-content;
}
.tab-btn {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #f3f5f8;
  color: var(--muted);
  box-shadow: none;
}
.tab-btn.active {
  color: white;
  border-color: var(--accent);
  background: var(--accent);
}

.search-zone {
  padding: 20px;
}

.search-form {
  display: grid;
  gap: 12px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 12px;
  align-items: center;
}

input,
select,
button {
  min-height: 48px;
  border-radius: 7px;
  border: 1px solid var(--line);
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(8 127 140 / 14%);
  outline: none;
}

input {
  font-size: 17px;
}

button {
  cursor: pointer;
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  font-weight: 700;
  box-shadow: 0 8px 18px rgb(8 127 140 / 18%);
}

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

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}

.filters label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.message {
  margin: 16px 0;
  padding: 11px 12px;
  border-radius: 8px;
  background: var(--soft);
  color: #164e55;
  font-size: 14px;
}

.message.warn {
  background: #fff7ed;
  color: var(--warn);
}

.results {
  display: grid;
  gap: 9px;
}

.result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 14px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.result h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.25;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf1f5;
}

.badge.seed {
  color: var(--good);
}

.downloads-panel {
  padding: 18px 20px;
}
.admin-panel {
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgb(16 24 40 / 7%);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

#refreshTorrents {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
  box-shadow: none;
}

.torrent-list {
  display: grid;
  gap: 8px;
}
.admin-list {
  display: grid;
  gap: 8px;
}

.torrent {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}
.admin-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}
.admin-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.admin-row strong {
  overflow-wrap: anywhere;
}
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-actions button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
  box-shadow: none;
}
.btn-pause {
  background: #0f766e;
  border-color: #0f766e;
}
.btn-resume {
  background: #047857;
  border-color: #047857;
}
.btn-delete {
  background: #9f1239;
  border-color: #9f1239;
}
.btn-delete-files {
  background: #b91c1c;
  border-color: #b91c1c;
}

.torrent strong {
  display: block;
  overflow-wrap: anywhere;
  margin-bottom: 7px;
}

.progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6e9e0;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

.small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 13px 14px;
  border-radius: 8px;
  background: #18211f;
  color: white;
  box-shadow: 0 12px 40px rgb(0 0 0 / 18%);
}

.download-splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #050505;
  opacity: 0;
  pointer-events: none;
}

.download-splash.show {
  animation: splash-fade 2s ease forwards;
}

.download-splash img {
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

@keyframes splash-fade {
  0% {
    opacity: 0;
  }

  12%,
  72% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

.entry-body {
  min-height: 100vh;
  background: #07121b;
}

.entry-screen {
  display: grid;
  min-height: 100vh;
  align-items: end;
  justify-items: center;
  padding: clamp(16px, 5vw, 34px);
  background:
    linear-gradient(180deg, rgb(0 0 0 / 0%) 0%, rgb(0 0 0 / 0%) 48%, rgb(0 0 0 / 68%) 100%),
    var(--entry-photo) center / contain no-repeat;
}

.entry-panel {
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 8px;
  background: rgb(8 14 20 / 76%);
  box-shadow: 0 18px 46px rgb(0 0 0 / 36%);
  backdrop-filter: blur(12px);
}

.entry-label {
  color: rgb(255 255 255 / 78%);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 10px;
}

.entry-row input {
  border-color: rgb(255 255 255 / 24%);
  background: rgb(255 255 255 / 92%);
}

.entry-row button {
  background: #272d35;
  border-color: rgb(255 255 255 / 24%);
  box-shadow: none;
}

.entry-row button:hover {
  background: #111820;
}

.entry-error {
  color: #fecdd3;
  font-weight: 700;
}

@media (max-width: 640px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .search-row,
  .filters,
  .result {
    grid-template-columns: 1fr;
  }

  .entry-screen {
    background-size: cover;
    background-position: center;
  }

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

  .landing-actions {
    grid-template-columns: 1fr;
    width: min(260px, calc(100vw - 32px));
  }

  .landing-shell {
    justify-items: center;
    padding-bottom: 18px;
  }

  h1 {
    font-size: 30px;
  }

  .landing-hero h1 {
    font-size: 42px;
  }
}
