:root {
  --bg:      #0b0d12;
  --panel:   #12151b;
  --panel-2: #171b23;
  --edge:    #262c39;
  --text:    #e7eaf0;
  --muted:   #949dae;
  --label:   #63769a;
  --accent:  #4da3ff;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  display: grid;
  grid-template-columns: minmax(17rem, 22rem) 1fr;
  grid-template-rows: auto 1fr;
  gap: 1.25rem;
  margin: 0;
  padding: 1.25rem;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 1.1rem;
}

/* ---------- header ---------- */

#app-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: .85rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--edge);
}

#app-header img {
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
}

#app-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -.01em;
}


/* ---------- catalogue ---------- */

#catalogue {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  overflow-y: auto;
  padding-right: .35rem;
}

.card {
  padding: .85rem 1rem;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
  outline: none;
}

.card h1 {
  margin: 0 0 .2rem;
  font-size: 1.7rem;
  font-weight: 600;
}

.card p {
  margin: 0;
  color: var(--muted);
  /* keep every card the same height however long the description is */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card:focus,
.card.focused,
.card:hover {
  background: var(--panel-2);
  border-color: var(--accent);
}

/* ---------- details ---------- */

#details {
  overflow-y: auto;
  padding: 2rem 2.25rem;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 12px;
}

#details-name {
  margin: 0 0 .5rem;
  font-size: 1.9rem;
  font-weight: 650;
  letter-spacing: -.01em;
}

#details-desc {
  max-width: 65ch;
  margin: 0 0 2.25rem;
  color: var(--muted);
}

#details label {
  display: block;
  margin-bottom: .4rem;
  color: var(--label);
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
}

#details label + p {
  margin: 0 0 1.75rem;
}

#details-src {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--accent);
  word-break: break-all;
}

#details-contrib {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.contributor {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .25rem .7rem .25rem .3rem;
  background: var(--panel-2);
  border: 1px solid var(--edge);
  border-radius: 999px;
  font-size: .95rem;
  white-space: nowrap;
}

.contributor img {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--edge);
  object-fit: cover;
}

#pick-dialog {
  width: min(34rem, 90vw);
  padding: 1.5rem;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--edge);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}

#pick-dialog::backdrop {
  background: rgba(4, 6, 12, .65);
}

#pick-title {
  margin: 0 0 .25rem;
  font-weight: 650;
}

#pick-title::after {
  content: "Choose a release";
  display: block;
  margin: .35rem 0 1rem;
  color: var(--label);
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  font-size: .9rem;
}

#pick-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

#pick-list button {
  width: 100%;
  padding: .7rem .9rem;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--panel-2);
  border: 1px solid var(--edge);
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
  outline: none;
}

#pick-list button.focused,
#pick-list button:hover {
  background: #1c2231;
  border-color: var(--accent);
}

#toast-list {
  position: fixed;
  bottom: 20px;
  left: 0;
  width: 100%;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;

  background: transparent;
  z-index: 9999;
}

#toast-list p {
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--edge);
    padding: 12px 20px;
    border-radius: 6px;

  margin: 0;
}

/* ---------- trim ---------- */

::selection { background: var(--accent); color: #04070d; }

#catalogue, #details {
  scrollbar-width: thin;
  scrollbar-color: var(--edge) transparent;
}

/* narrow window: stack instead of squeezing the two columns */
@media (max-width: 820px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
  }
  #catalogue { flex-direction: row; overflow-x: auto; }
  .card { flex: 0 0 15rem; }
}
