/* ==========================================================================
   가상캐스팅(Fan casting) — 캐스팅 페이지와 작품 정보 진입 섹션
   색은 전부 hbl.css 의 변수라 다크 모드가 자동으로 따라온다.
   ========================================================================== */

.hbl-casting {
  padding: 20px 0 48px;
  color: var(--color-content-neutral-strong);
}
.hbl-casting .container {
  max-width: 720px;
}
/* 사이트의 보조 버튼은 대개 <a> 라 배경이 투명하다. <button> 은 브라우저 기본 회색이 남아 다크 모드에서 글자가 안 보인다 */
.hbl-casting .hbl-btn-secondary,
.hbl-casting-sheet .hbl-btn-secondary {
  background-color: transparent;
}
.hbl-casting__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--color-content-neutral-strong);
}
.hbl-casting__back svg {
  width: 16px;
  height: 16px;
}
.hbl-casting__head {
  margin-top: 24px;
}
.hbl-casting__eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-content-primary);
}
.hbl-casting__title {
  margin: 0;
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
  text-wrap: balance;
}
.hbl-casting__sub em {
  font-style: italic;
}
.hbl-casting__sub {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-content-neutral-medium);
}

/* 캐릭터 카드 */
.hbl-casting-character {
  display: flex;
  align-items: center; /* 일러스트를 카드 세로 가운데에 */
  gap: 12px;
  margin-top: 24px;
  padding: 12px;
  border-radius: 12px;
  background: var(--color-background-main-content-pink);
}
.hbl-casting-character__thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 92px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--color-background-sub-content);
}
.hbl-casting-character__name {
  margin: 0;
  font-size: 20px;
  line-height: 26px;
  font-weight: 700;
}
.hbl-casting-character__intro {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 19px;
  color: var(--color-content-neutral-medium);
}
.hbl-casting-character__intro p {
  margin: 0 0 4px;
}

/* 후보 카드 2열 */
.hbl-casting-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}
@media (min-width: 560px) {
  .hbl-casting-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.hbl-casting-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  text-align: left;
  border: 1px solid var(--color-border-neutral);
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-background-main-content);
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}
.hbl-casting-card:hover {
  border-color: var(--color-content-neutral-medium);
}
.hbl-casting-card:focus-visible {
  outline: 2px solid var(--color-content-primary);
  outline-offset: 2px;
}
.hbl-casting-card.is-selected {
  border-color: var(--color-content-primary);
  box-shadow: inset 0 0 0 1px var(--color-content-primary);
  background: var(--color-background-main-content-pink);
}
.hbl-casting-card__photo {
  position: relative;
  display: block;
  aspect-ratio: 173 / 208;
  background: var(--color-background-sub-content);
  overflow: hidden;
}
.hbl-casting-card__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hbl-casting-card__nophoto {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--color-border-neutral);
}
.hbl-casting-card__mark {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border-neutral);
  background: rgba(255, 255, 255, 0.85);
  color: transparent;
}
.hbl-casting-card.is-selected .hbl-casting-card__mark {
  border-color: var(--color-content-primary);
  background: var(--color-content-primary);
  color: #fff;
}
.hbl-casting-card__copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 10px 12px;
}
.hbl-casting-card__name {
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hbl-casting-card__group {
  font-size: 11px;
  line-height: 16px;
  font-weight: 500;
  color: var(--color-content-neutral-medium);
}
.hbl-casting-card.is-selected .hbl-casting-card__group {
  color: var(--color-content-primary);
}
.hbl-casting-card__reason {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 48px;
  font-size: 12px;
  line-height: 16px;
  color: var(--color-content-neutral-medium);
}

/* 출처 · 안내 */
.hbl-casting__credit,
.hbl-casting__disclaimer,
.hbl-casting__note,
.hbl-casting__helper {
  font-size: 12px;
  line-height: 18px;
  color: var(--color-content-neutral-medium);
}
.hbl-casting__credit {
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 16px;
}
.hbl-casting__credit a {
  color: var(--color-content-primary);
  text-decoration: underline;
}
.hbl-casting__disclaimer {
  margin: 6px 0 0;
}

/* 투표 바 — 후보가 많아 모바일에서는 아래에 고정 */
.hbl-casting-votebar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin: 20px -15px 0; /* 부트스트랩 .container 좌우 여백(15px)만큼 — 16px 이면 화면이 1px 넘친다 */
  padding: 12px 15px calc(12px + env(safe-area-inset-bottom));
  background: var(--color-background-main-content);
  border-top: 1px solid var(--color-border-neutral);
}
@media (min-width: 768px) {
  .hbl-casting-votebar {
    position: static;
    margin: 20px 0 0;
    padding: 0;
    border-top: 0;
  }
}
.hbl-casting-votebar .hbl-btn {
  width: 100%;
  justify-content: center;
}
.hbl-casting-votebar .hbl-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.hbl-casting__helper {
  margin: 8px 0 0;
}

/* 제안 */
.hbl-casting-suggest {
  margin-top: 20px;
}
.hbl-casting-suggest__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
  color: var(--color-content-neutral-strong);
  cursor: pointer;
}
.hbl-casting-suggest__link svg {
  width: 16px;
  height: 16px;
}
.hbl-casting__note {
  margin: 6px 0 0;
}

.hbl-casting__divider {
  height: 1px;
  margin: 24px 0;
  background: var(--color-border-neutral);
}

/* 결과 */
.hbl-casting-results {
  padding: 16px;
  border: 1px solid var(--color-border-neutral);
  border-radius: 12px;
}
.hbl-casting-results__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hbl-casting-results__head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
}
.hbl-casting-results__total {
  font-size: 12px;
  line-height: 16px;
  color: var(--color-content-neutral-medium);
}
.hbl-casting-results__list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hbl-casting-results__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}
.hbl-casting-results__name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.hbl-casting-results__pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-background-main-content-pink);
  color: var(--color-content-primary);
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
}
.hbl-casting-results__row.is-mine .hbl-casting-results__pct {
  color: var(--color-content-primary);
}
.hbl-casting-results__track {
  height: 8px;
  margin-top: 6px;
  border-radius: 4px;
  background: var(--color-background-sub-content);
  overflow: hidden;
}
.hbl-casting-results__fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--color-content-neutral-medium);
  transition: width 0.4s ease;
}
.hbl-casting-results__row.is-mine .hbl-casting-results__fill {
  background: var(--color-content-primary);
}

/* 이유 설문 */
.hbl-casting-reason {
  margin-top: 20px;
}
.hbl-casting-reason__head {
  font-size: 15px;
  line-height: 20px;
}
.hbl-casting-reason__head span {
  margin-left: 6px;
  font-size: 12px;
  color: var(--color-content-neutral-medium);
}
.hbl-casting-reason__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.hbl-casting-chip {
  padding: 6px 12px;
  border: 1px solid var(--color-border-neutral);
  border-radius: 999px;
  background: var(--color-background-main-content);
  color: var(--color-content-neutral-strong);
  font: inherit;
  font-size: 13px;
  line-height: 18px;
  cursor: pointer;
}
.hbl-casting-chip.is-selected {
  border-color: var(--color-content-primary);
  background: var(--color-background-main-content-pink);
  color: var(--color-content-primary);
  font-weight: 600;
}

/* 작성 칸 */
.hbl-casting-composer {
  margin-top: 24px;
}
.hbl-casting-composer h2,
.hbl-casting-takes__title {
  margin: 0;
  font-size: 20px;
  line-height: 26px;
  font-weight: 700;
}
.hbl-casting textarea,
.hbl-casting input[type="text"] {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--color-border-neutral);
  border-radius: 8px;
  background: var(--color-background-main-content);
  color: var(--color-content-neutral-strong);
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  resize: vertical;
}
.hbl-casting textarea:focus,
.hbl-casting input[type="text"]:focus {
  outline: none;
  border-color: var(--color-content-primary);
}
.hbl-casting-composer__form textarea {
  margin-top: 12px;
}
.hbl-casting-composer__row,
.hbl-casting-replybox__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}
.hbl-casting-composer__pick {
  font-size: 12px;
  line-height: 16px;
  color: var(--color-content-neutral-medium);
}
.hbl-casting-composer__guide {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 18px;
  color: var(--color-content-neutral-medium);
}
.hbl-casting-locked {
  margin-top: 24px;
  padding: 16px;
  border: 1px dashed var(--color-border-neutral);
  border-radius: 12px;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-content-neutral-medium);
  text-align: center;
}

/* 의견 목록 */
.hbl-casting-takes {
  margin-top: 28px;
}
.hbl-casting-takes__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.hbl-casting-takes__count {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-content-primary);
}
.hbl-casting-takes__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}
.hbl-casting-takes__empty {
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-content-neutral-medium);
}
.hbl-casting-take {
  display: flex;
  gap: 10px;
}
.hbl-casting-take.is-reply {
  margin-top: 12px;
}
.hbl-casting-take__avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-background-sub-content);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-content-neutral-strong);
}
.hbl-casting-take__content {
  flex: 1;
  min-width: 0;
}
.hbl-casting-take__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 14px;
  line-height: 20px;
}
.hbl-casting-take__name {
  font-weight: 600;
}
.hbl-casting-take__pick {
  font-size: 12px;
  color: var(--color-content-neutral-medium);
}
.hbl-casting-take__body {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 20px;
  overflow-wrap: anywhere;
}
.hbl-casting-take__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: var(--color-content-neutral-medium);
}
.hbl-casting-take__action {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-content-neutral-medium);
  cursor: pointer;
}
.hbl-casting-take__action:hover {
  color: var(--color-content-neutral-strong);
}
.hbl-casting-replybox {
  margin-top: 10px;
}
.hbl-casting-replybox[hidden] {
  display: none;
}

/* 아래 */
.hbl-casting__read {
  margin-top: 28px;
}
.hbl-casting__read .hbl-btn {
  width: 100%;
  justify-content: center;
}
.hbl-casting__foot {
  margin-top: 24px;
  text-align: center;
}
.hbl-casting__foot p {
  margin: 0;
  font-size: 12px;
  line-height: 18px;
  color: var(--color-content-neutral-medium);
}
.hbl-casting__foot a {
  color: var(--color-content-neutral-medium);
  text-decoration: underline;
}
.hbl-casting__foot .links {
  margin-top: 8px;
}

/* 아래에서 올라오는 창 */
.hbl-casting-sheet {
  position: fixed;
  inset: 0;
  z-index: 1060;
}
.hbl-casting-sheet[hidden] {
  display: none;
}
.hbl-casting-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.hbl-casting-sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 85vh;
  overflow: auto;
  margin: 0 auto;
  max-width: 560px;
  padding: 10px 16px calc(24px + env(safe-area-inset-bottom));
  border: 1px solid var(--color-border-neutral);
  border-radius: 16px 16px 0 0;
  background: var(--color-background-main-content);
  color: var(--color-content-neutral-strong);
}
@media (min-width: 768px) {
  .hbl-casting-sheet__panel {
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 16px;
    padding-bottom: 24px;
  }
}
.hbl-casting-sheet__handle {
  width: 36px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 2px;
  background: var(--color-border-neutral);
}
.hbl-casting-sheet h2 {
  margin: 0;
  font-size: 20px;
  line-height: 26px;
  font-weight: 700;
}
.hbl-casting-sheet__sub {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-content-neutral-medium);
}
.hbl-casting-field {
  display: block;
  margin-top: 14px;
}
.hbl-casting-field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
}
.hbl-casting-field__label em {
  margin-left: 6px;
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  color: var(--color-content-neutral-medium);
}
.hbl-casting-sheet__rules {
  margin: 14px 0 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 18px;
  color: var(--color-content-neutral-medium);
}
.hbl-casting-sheet__actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.hbl-casting-sheet__actions .hbl-btn {
  flex: 1;
  justify-content: center;
}
.hbl-casting-sheet__close {
  width: 100%;
  justify-content: center;
  margin-top: 14px;
}
.hbl-casting-sources {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12px;
  line-height: 18px;
  color: var(--color-content-neutral-medium);
}
.hbl-casting-sources strong {
  display: block;
  color: var(--color-content-neutral-strong);
}
.hbl-casting-sources a {
  color: var(--color-content-primary);
  text-decoration: underline;
}

/* 작품 정보의 진입 섹션 */
.hbl-casting-entry {
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
  background: var(--color-background-main-content-pink);
}
.hbl-casting-entry__eyebrow {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-content-primary);
}
.hbl-casting-entry__title {
  margin: 6px 0 0;
  font-size: 20px;
  line-height: 26px;
  font-weight: 700;
  color: var(--color-content-neutral-strong);
}
.hbl-casting-entry__sub {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 19px;
  color: var(--color-content-neutral-medium);
}
.hbl-casting-entry__proof {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.hbl-casting-entry__avatars {
  display: flex;
}
.hbl-casting-entry__avatars span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: -8px;
  border: 2px solid var(--color-background-main-content-pink);
  border-radius: 50%;
  background: var(--color-background-sub-content);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-content-neutral-medium);
}
.hbl-casting-entry__avatars span:first-child {
  margin-left: 0;
}
.hbl-casting-entry__count {
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  color: var(--color-content-neutral-strong);
}
.hbl-casting-entry__cta {
  margin-top: 12px;
  width: 100%;
  justify-content: center;
  height: 36px;
}

/* 상태 전환용 */
.hbl-casting [hidden],
.hbl-casting-sheet[hidden] {
  display: none !important;
}
body.hbl-casting-sheet-open {
  overflow: hidden;
}
.hbl-casting-change {
  margin-top: 12px;
  text-align: right;
}
.hbl-casting-change__btn,
.hbl-casting__credit-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--color-content-primary);
  text-decoration: underline;
  cursor: pointer;
}
.hbl-casting-change__btn {
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
}
.hbl-casting-takes__list.is-collapsed > .hbl-casting-take:nth-child(n + 4) {
  display: none;
}
.hbl-casting-takes__more {
  width: 100%;
  justify-content: center;
  margin-top: 16px;
}
.hbl-casting-take__thread {
  margin-top: 4px;
}

/* 제목 색을 명시 — 부모 테마의 h1/h2 색이 다크 모드에서 검게 남는 것을 막는다 */
.hbl-casting__title,
.hbl-casting-results__head h2,
.hbl-casting-composer h2,
.hbl-casting-takes__title,
.hbl-casting-sheet h2,
.hbl-casting-character__name,
.hbl-casting-reason__head {
  color: var(--color-content-neutral-strong);
}
