/* mods.catosaur.xyz. Tokens and shared parts live in base.css. */

.intro {
  padding-block: clamp(32px, 6vw, 72px) 8px;
}

.lede {
  margin-top: 16px;
  max-width: 60ch;
  color: var(--muted);
  font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
}

/* Loading, empty and error states */
.state {
  margin-top: 32px;
  padding: 16px 18px;
  background: var(--surface);
  border: 2px dashed var(--line);
  max-width: 60ch;
}

.state .btn {
  margin-top: 14px;
}

/* Groups: each audience gets its own composition, so the page reads as
   "what do I install where" instead of one uniform grid. */
.group {
  margin-top: clamp(40px, 7vw, 80px);
}

.group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 20px;
  margin-bottom: 20px;
}

.group-head p {
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 2px solid var(--line);
  transition: box-shadow 80ms ease-out, border-color 80ms ease-out;
}

.card:hover,
.card:focus-within {
  border-color: var(--pink);
  box-shadow: 6px 6px 0 var(--band);
}

.card h3 {
  font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.5rem);
}

.summary {
  margin-top: 6px;
}

.meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.95rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Icon tile: the light backing keeps transparent and black icons visible. */
.tile {
  flex: none;
  background: var(--tile);
  padding: 4px;
  width: 72px;
  height: 72px;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tile-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: var(--band);
  color: var(--text);
  font-family: var(--font-pixel);
  font-size: 1.75rem;
}

/* Server owners: wide rows, because these entries carry the most setup text. */
.rows {
  display: grid;
  gap: 16px;
}

.card h3,
.dialog-titles h2 {
  overflow-wrap: anywhere;
}

.row > div,
.slim > div {
  min-width: 0;
}

.row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px 20px;
  padding: 18px;
}

@media (max-width: 720px) {
  .row {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .row .actions {
    grid-column: 1 / -1;
  }
}

/* Players: screenshot-led cards, because the in-game look is what sells them. */
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 20px;
}

.shot {
  display: flex;
  flex-direction: column;
}

.shot-img {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  border-bottom: 2px solid var(--line);
}

.shot-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 18px;
  flex: 1;
}

.shot-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shot-title .tile {
  width: 48px;
  height: 48px;
  padding: 3px;
}

.shot .actions {
  margin-top: auto;
  padding-top: 18px;
}

/* Desktop tools: one wide feature card with the app screenshot beside it. */
.feature {
  display: grid;
  grid-template-columns: 1fr;
}

.feature-text {
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.feature-text .actions {
  margin-top: 18px;
}

.feature img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left top;
  border-bottom: 2px solid var(--line);
}

@media (min-width: 880px) {
  .feature {
    grid-template-columns: 2fr 3fr;
  }

  .feature img {
    order: 2;
    border-bottom: 0;
    border-left: 2px solid var(--line);
  }
}

/* In development: dashed edge marks an unfinished project. */
.slim {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px 18px;
  padding: 14px 18px;
  border-style: dashed;
}

.slim .tile {
  width: 56px;
  height: 56px;
}

.status {
  font-family: var(--font-pixel);
  color: var(--pink);
  font-size: 0.95rem;
}

@media (max-width: 720px) {
  .slim {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .slim .actions {
    grid-column: 1 / -1;
  }
}

/* Detail popup */
body:has(dialog[open]) {
  overflow: hidden;
}

.dialog {
  padding: 0;
  width: min(780px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--pink);
  box-shadow: 8px 8px 0 var(--band);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dialog[open] {
  animation: dialog-in 140ms ease-out;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.dialog::backdrop {
  background: rgb(10 3 7 / 0.82);
}

.dialog-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border-bottom: 2px solid var(--surface-2);
}

.dialog-head .tile {
  width: 64px;
  height: 64px;
}

.dialog-titles {
  min-width: 0;
}

.dialog-titles .meta {
  margin-top: 4px;
}

@media (max-width: 520px) {
  .dialog-head {
    grid-template-columns: auto 1fr;
  }

  .dialog-head .tile {
    width: 48px;
    height: 48px;
  }

  .dialog-head .close {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

.dialog-body {
  padding: 4px 18px 8px;
}

.dialog-body > * + * {
  margin-top: 22px;
}

.dialog-body .lead p + p {
  margin-top: 10px;
}

.dialog-shot {
  border: 2px solid var(--line);
  width: 100%;
  margin-top: 16px;
}

.dialog-body h3 {
  font-size: 1.2rem;
  color: var(--pink);
  margin-bottom: 10px;
}

.dialog-body ul,
.dialog-body ol {
  margin: 0;
  padding-left: 1.3em;
}

.dialog-body li + li {
  margin-top: 6px;
}

.dialog-body li::marker {
  color: var(--pink);
}

.settings {
  margin: 0;
  display: grid;
  gap: 10px;
}

.settings div {
  background: var(--surface-2);
  padding: 10px 12px;
}

.settings dt {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
}

.settings dt code {
  background: none;
  padding: 0;
  color: var(--text);
  font-weight: 600;
}

.settings .default {
  color: var(--muted);
  font-size: 0.9rem;
}

.settings dd {
  margin: 4px 0 0;
  color: var(--muted);
}

.notes {
  background: var(--surface-2);
  padding: 14px 16px;
}

.notes ul {
  padding-left: 1.1em;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px;
  border-top: 2px solid var(--surface-2);
}

.dialog-actions .disabled-note {
  color: var(--muted);
  align-self: center;
}
