/* The character-select stage: a wall of portraits. */

#stageSelect { overflow-y: auto; padding: var(--sp-6) var(--sp-5) 72px; }
.select-inner { width: 100%; max-width: 1180px; margin: 0 auto; }

.select-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.select-head h1 { font-size: clamp(30px, 3.4vw, 42px); line-height: 1.08; letter-spacing: -.02em; }

.group-title { font-size: 14px; font-weight: 600; color: var(--muted); margin: 36px 0 14px; }
.group-title:first-child { margin-top: 0; }

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

.char-card {
  position: relative; aspect-ratio: 3 / 4; padding: 0; overflow: hidden; text-align: left; display: block;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  color: var(--text); cursor: pointer;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.char-card:hover, .char-card:focus-visible {
  transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 18px 36px rgba(0, 0, 0, .4);
}
.char-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.char-card .portrait { position: absolute; inset: 0; background: var(--panel2); }
.char-card .portrait img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.char-card:hover .portrait img { transform: scale(1.03); }
.char-card .portrait .initial {
  position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%);
  font-family: var(--font-display); font-size: 88px; color: var(--faint); user-select: none;
}

/* Name and genre sit on the picture; the scrim is only there so they stay readable. */
.char-card .scrim {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 64px 16px 16px;
  background: linear-gradient(to top, rgba(8, 8, 12, .92) 0%, rgba(8, 8, 12, .7) 48%, transparent 100%);
  display: flex; flex-direction: column; gap: 2px; color: #fff;
}
.char-card .nm { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 21px; line-height: 1.15; letter-spacing: var(--display-track); }
.char-card .genre { font-size: 13px; color: rgba(255, 255, 255, .72); }
.char-card .blurb {
  font-size: 13px; line-height: 1.45; color: rgba(255, 255, 255, .85); margin-top: 6px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  max-height: 0; opacity: 0; transition: max-height .3s ease, opacity .25s ease;
}
.char-card:hover .blurb, .char-card:focus-visible .blurb, .char-card:focus-within .blurb { max-height: 70px; opacity: 1; }
@media (hover: none) { .char-card .blurb { display: none; } }

.char-card .flag {
  position: absolute; top: 12px; left: 12px; font-size: 12px; font-weight: 500; color: #fff;
  background: rgba(8, 8, 12, .7); border: 1px solid rgba(255, 255, 255, .12); border-radius: 999px; padding: 3px 10px;
}
.char-card .flag.talked { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.char-card .learn-more {
  position: absolute; top: 10px; right: 10px; padding: 4px 12px; font-size: 12px; font-weight: 500;
  background: rgba(8, 8, 12, .7); color: #fff; border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px;
  opacity: 0; transition: opacity .2s;
}
.char-card:hover .learn-more, .char-card:focus-within .learn-more { opacity: 1; }
@media (hover: none) { .char-card .learn-more { opacity: 1; } }
.char-card .learn-more:hover:not(:disabled) { background: rgba(8, 8, 12, .92); border-color: rgba(255, 255, 255, .3); }

.select-empty { color: var(--muted); text-align: center; padding: 48px 16px; grid-column: 1 / -1; }
