/*
  Characters: the tile grid and the reference strip.

  A character is mostly its pictures, so both views lead with the picture and
  let the text sit under it. The tile is taller than a dataset tile for the same
  reason: a face at 72px is not a face.
*/

.cast-tile {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--t-fast), transform var(--t-fast);
}

.cast-tile:hover {
  border-color: var(--border-2);
  transform: translateY(-1px);
}

.cast-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 5;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--s3);
  color: var(--fg-3);
}

.cast-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Reference strip ------------------------------------------------------ */

.cast-refs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--sp-3);
}

.cast-ref {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: var(--sp-2);
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

/* The cover is one of the references, so it is marked rather than repeated. */
.cast-ref.is-cover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.cast-ref a {
  display: block;
  aspect-ratio: 1;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--s3);
}

.cast-ref img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cast-ref select {
  max-width: 110px;
}

/* "Use a character" on the create form ---------------------------------- */

.cast-bar-refs {
  display: flex;
  gap: 4px;
}

.cast-bar-refs img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--s3);
}

/* A reference whose file has been moved or deleted. */
.cast-gone {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 12px;
  color: var(--warn, var(--fg-3));
}
