/* 投票箱: お題のページ(選択肢・結果・ログインの枠・共有)。
   枠・バッジ・ボタン・チェック・空状態・お題一覧の行は common/components.css の .th-* を使う。 */

:root {
  --vote-bar-color: var(--th-brand-200);
  --vote-bar-mine-color: var(--th-cat-rod-soft);
}

/* --- 見出し --- */
.vote-detail-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.vote-title {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.4;
  color: var(--th-color-heading);
  overflow-wrap: anywhere;
}

.vote-description {
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.vote-meta {
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--th-color-text-muted);
}

.vote-meta-count {
  font-weight: 700;
  color: var(--th-color-text);
}

/* --- 選択肢 --- */
.vote-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.vote-choice {
  display: flex;
  padding: 12px;
  background: var(--th-color-surface);
  border: var(--th-border-inner);
  overflow-wrap: anywhere;
}

.vote-choice:has(input:checked) {
  border-color: var(--th-brand-800);
  background: var(--th-brand-50);
}

.vote-choice:has(input:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
}

.vote-choices-preview {
  margin-bottom: 16px;
}

.vote-sub-link {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  text-align: center;
  color: var(--th-color-link);
}

/* --- 結果: 棒の長さはテンプレートが --vote-bar で渡す --- */
.vote-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.vote-result {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--th-color-surface);
  border: var(--th-border-inner);
  overflow: hidden;
}

.vote-result::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--vote-bar, 0%);
  background: var(--vote-bar-color);
}

.vote-result.is-mine { border-color: var(--th-brand-800); }
.vote-result.is-mine::before { background: var(--vote-bar-mine-color); }

.vote-result > span {
  position: relative;
  color: var(--th-color-text);
}

.vote-result-rank {
  flex: none;
  width: 1.5em;
  font-weight: 700;
  text-align: center;
}

.vote-result-label {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.vote-result-mine {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--th-brand-600);
  white-space: nowrap;
}

.vote-result-value {
  flex: none;
  font-weight: 700;
}

/* --- ログインを促す枠 --- */
.vote-login-box { margin-bottom: 16px; }

.vote-login-note {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--th-color-text-muted);
}

/* ボタンの影の分だけ離す */
.th-alert-actions + .vote-login-note { margin-top: 12px; }

/* --- 共有 --- */
.vote-share {
  margin-top: 24px;
  padding-top: 16px;
  border-top: var(--th-border-inner);
}

.vote-share-title {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--th-color-heading);
}

/* --- お題一覧 --- */
.vote-intro {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--th-color-text-muted);
}

.vote-more {
  display: inline-block;
  margin-top: 8px;
}

.vote-other { margin-top: 32px; }
