:root {
  --bg: #0b0b12;
  --bg-2: #12121c;
  --panel: #161623;
  --line: #262637;
  --text: #e8e8f2;
  --muted: #9a9ab0;
  --accent: #7c5cff;
  --accent-2: #29d3c2;
  --radius: 16px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(124, 92, 255, 0.22), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(41, 211, 194, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  font: 16px/1.5 ui-sans-serif, system-ui, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

code {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 0.9em;
  color: var(--muted);
}

/* header */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 5vw, 56px);
  max-width: 1240px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: #09090f;
  font-size: 15px;
}

.top-nav {
  display: flex;
  gap: 8px;
}

.ghost {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  text-decoration: none;
  font-size: 14px;
  color: var(--muted);
  transition: 0.15s;
}

.ghost:hover {
  color: var(--text);
  border-color: #3a3a55;
  background: var(--panel);
}

/* hero */

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 8px clamp(16px, 5vw, 56px) 72px;
}

.hero {
  padding: clamp(16px, 4vw, 40px) 0 28px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.1;
  letter-spacing: -1px;
  background: linear-gradient(100deg, #fff 20%, #b9aeff 60%, #7ef0e2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  margin: 0 0 22px;
  max-width: 640px;
  color: var(--muted);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

#search {
  flex: 1 1 280px;
  max-width: 430px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(18, 18, 28, 0.85);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: 0.15s;
}

#search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}

.chips {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(18, 18, 28, 0.6);
}

.chip {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 14px;
  cursor: pointer;
  transition: 0.15s;
}

.chip:hover {
  color: var(--text);
}

.chip.is-active {
  background: var(--panel);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

/* grid */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 0.18s,
    border-color 0.18s,
    box-shadow 0.18s;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-3px);
  border-color: #3a3a58;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9);
  outline: none;
}

.thumb {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(120% 120% at 20% 0%, hsl(var(--hue, 260) 80% 55% / 0.35), transparent 65%),
    linear-gradient(140deg, hsl(var(--hue, 260) 45% 16%), #0d0d16);
  overflow: hidden;
}

.thumb img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-glyph {
  position: absolute;
  font-size: 72px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.08);
  letter-spacing: -4px;
}

.card-body {
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-head h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.ver {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  padding: 3px 7px;
  border-radius: 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.desc {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.author {
  font-size: 13px;
  color: var(--muted);
}

.badges {
  display: inline-flex;
  gap: 6px;
}

.badge {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.badge.stable {
  color: #7ef0e2;
  background: rgba(41, 211, 194, 0.12);
  border-color: rgba(41, 211, 194, 0.3);
}

.badge.beta {
  color: #ffcf7a;
  background: rgba(255, 190, 80, 0.1);
  border-color: rgba(255, 190, 80, 0.28);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 8px 16px 16px;
  padding: 10px 16px;
  border-radius: 11px;
  border: 1px solid rgba(124, 92, 255, 0.45);
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.28), rgba(124, 92, 255, 0.12));
  color: #ded8ff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: 0.15s;
}

.btn:hover {
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.42), rgba(124, 92, 255, 0.2));
  border-color: var(--accent);
}

.btn.small {
  margin: 10px 0 0;
  padding: 8px 12px;
  font-size: 13px;
  align-self: flex-start;
}

.btn:disabled {
  opacity: 0.5;
  cursor: progress;
}

/* dialog */

.details {
  width: min(720px, 92vw);
  max-height: 86vh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg-2);
  color: var(--text);
  box-shadow: 0 40px 120px -30px #000;
}

.details::backdrop {
  background: rgba(5, 5, 10, 0.72);
  backdrop-filter: blur(6px);
}

#detailsBody {
  padding: 22px;
}

.close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(10, 10, 16, 0.7);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.close:hover {
  color: var(--text);
}

.dlg-head {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.dlg-thumb {
  position: relative;
  flex: 0 0 96px;
  height: 96px;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 120% at 20% 0%, hsl(var(--hue, 260) 80% 55% / 0.4), transparent 65%),
    linear-gradient(140deg, hsl(var(--hue, 260) 45% 16%), #0d0d16);
}

.dlg-thumb img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dlg-thumb .thumb-glyph {
  font-size: 40px;
}

.dlg-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.dlg-desc {
  color: #c9c9db;
  margin: 0 0 12px;
  white-space: pre-wrap;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.tags span {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 3px 9px;
  border-radius: 999px;
}

.dlg-sub {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
}

.versions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.versions li {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(11, 11, 18, 0.6);
}

.v-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.changelog {
  margin-top: 8px;
  font-size: 13px;
}

.changelog summary {
  cursor: pointer;
  color: var(--muted);
}

.changelog pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  color: #c9c9db;
  margin: 8px 0 0;
}

/* empty / footer */

.empty {
  text-align: center;
  padding: 60px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.empty h2 {
  margin: 0 0 6px;
  color: var(--text);
}

.foot {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px clamp(16px, 5vw, 56px) 40px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #6b6b85;
  font-size: 13px;
  border-top: 1px solid rgba(38, 38, 55, 0.6);
}

/* forms */

.panel {
  max-width: 720px;
  margin: 0 auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-size: 13px;
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #0e0e18;
  color: var(--text);
  font: inherit;
  outline: none;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.field .hint {
  font-size: 12px;
  color: #6b6b85;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 560px) {
  .row {
    grid-template-columns: 1fr;
  }
}

.note {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0e0e18;
  font-size: 13px;
  color: var(--muted);
}

.note.err {
  border-color: rgba(255, 90, 90, 0.4);
  color: #ffb3b3;
}

.note.good {
  border-color: rgba(41, 211, 194, 0.4);
  color: #8ff0e2;
}

a.btn {
  margin: 0;
}

/* queue */

.queue {
  display: grid;
  gap: 14px;
}

.item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.item h3 {
  margin: 0;
  font-size: 16px;
}

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

.item .actions .btn {
  margin: 0;
}

.item .changelog pre {
  max-height: 220px;
  overflow: auto;
}

/* auth */

.auth-slot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.auth-slot .who {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 14px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-slot .ghost {
  background: transparent;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.auth-panel {
  max-width: 460px;
}

.auth-panel .btn {
  margin: 8px 0 0;
  width: 100%;
}

.auth-alt {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.auth-alt a {
  color: #b9aeff;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 10px;
}

.auth-actions .btn {
  margin: 0;
}

.ghost-link {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: #b9aeff;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.section-head {
  padding-top: 44px;
  padding-bottom: 14px;
}

.section-head h2 {
  margin: 0 0 6px;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.5px;
}

.section-head p {
  margin: 0;
}

