/* 社交互動原型樣式 v2（1a 精緻投票卡 + 1d 行內幽靈工具）
   本機試跑；正式站休眠——social.js 有 localhost/?social 保險絲 */

#lyrics li { position: relative; } /* 行內工具列的定位基準 */

/* ---------- PLLI 符號（可變色：background 吃 currentColor） ---------- */
.plli {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -.12em;
  background: currentColor;
  -webkit-mask: url('/plli-mask.png') center / contain no-repeat;
  mask: url('/plli-mask.png') center / contain no-repeat;
}

/* ---------- 1d 行內小工具列：active/hover 行才浮現的幽靈小標 ---------- */
.line-social {
  position: absolute;
  right: 10px;
  bottom: 9px;
  display: flex;
  gap: 5px;
  opacity: 0;
  transition: opacity .15s;
}
#lyrics li:hover .line-social,
#lyrics li.active .line-social,
.line-social:has(.on) { opacity: 1; }
.line-social button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink-dim);
  cursor: pointer;
  transition: transform .15s, color .2s, border-color .2s, background .2s;
}
.line-social button:hover { transform: translateY(-2px); }
.line-social .ls-n { font-family: var(--font-display); }
.ls-heart.on { color: var(--gold); border-color: var(--gold); background: var(--gold-bg); }
.ls-heart.on .plli { animation: plli-beat 1.2s ease-in-out infinite; }
.pop { animation: ls-pop .3s; }
@keyframes ls-pop { 40% { transform: scale(1.35) rotate(-6deg); } }
@keyframes plli-beat { 30% { transform: scale(1.25); } }

/* app.js 的「分享這一句」搬進同一排：改成 23px 幽靈圓鈕 */
.line-social .line-share {
  position: static;
  transform: none;
  width: 26px;
  height: 26px;
  padding: 0; /* 沿用工具列按鈕的 padding 會把 26px 圓鈕的內容區壓到 6px，svg 被 flex 硬縮 */
  justify-content: center;
  opacity: 1;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink-dim);
}
.line-social .line-share svg { width: 14px; height: 14px; flex: none; }

/* 應援行：只留一顆金色細框「一起喊」，常駐 */
.line-social.cheer { opacity: .9; }
.ls-cheer { color: var(--gold); border-color: var(--gold); background: transparent; }

/* ---------- 1d 感想抽屜 ---------- */
li.social-drawer {
  list-style: none;
  margin: 2px 0 10px;
  padding: 11px 13px;
  border-radius: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  cursor: default;
  opacity: 1 !important;
  animation: bp-in .25s both;
}
.sd-item { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; margin: 3px 0; color: var(--ink); }
.sd-av {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  background: rgba(157, 180, 255, .18);
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  font-style: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(3px);
}
.sd-item.me .sd-av { background: rgba(255, 95, 158, .15); color: #ff5f9e; }
.sd-ago { opacity: .45; font-style: normal; margin-left: auto; flex: none; font-size: 10px; }
.sd-empty { font-size: 12.5px; opacity: .5; margin: 2px 0 6px; }
.sd-row { display: flex; gap: 6px; margin-top: 9px; }
.sd-input {
  flex: 1;
  font: inherit;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink);
  outline: none;
}
.sd-send {
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, #ff5f9e, #ff8ab8);
  color: #fff;
  cursor: pointer;
}

/* ---------- 1a Killing Part 每日投票卡 ---------- */
/* 對齊歌詞：#lyrics 有 4px 內距、每行 li 再 18px，所以歌詞文字在 +22px。
   卡片用 margin-left:4px + padding-left:18px 湊出同一條線；
   上方 32px ≈ 下方 #lyrics 的 8vh 起始留白，讓它落在歌詞的節奏裡而不突兀。 */
#bias-card {
  margin: 32px 0 0 4px;
  padding: 15px 18px;
  border-radius: 18px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  max-width: 420px;
}
.bp-head { display: flex; align-items: center; gap: 8px; }
.bp-title { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--gold); }
.bp-title::before { content: '✦ '; }
.bp-live { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ink-dim); }
.bp-live b { font-family: var(--font-display); font-weight: 700; color: var(--ink); }
.bp-dot { width: 6px; height: 6px; border-radius: 50%; background: #ff5f9e; animation: bp-pulse 1.6s infinite; }
@keyframes bp-pulse { 50% { opacity: .35; } }
.bp-sub { font-size: 12.5px; color: var(--ink-dim); margin: 7px 0 14px; }

/* 選人列（單選）：英文名膠囊 */
.bp-row { display: flex; flex-wrap: wrap; gap: 7px; }
.bp-m {
  font: inherit;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--bc) 45%, transparent);
  background: color-mix(in srgb, var(--bc) 10%, transparent);
  color: var(--ink);
  cursor: pointer;
  transition: transform .15s, background .2s, border-color .2s, color .2s, opacity .2s;
}
.bp-m:hover { transform: translateY(-2px); }
.bp-row.has-sel .bp-m:not(.sel) { opacity: .45; }
.bp-m.sel {
  background: var(--bc);
  border-color: var(--bc);
  color: #fff;
  animation: bias-pick .35s;
}
@keyframes bias-pick { 40% { transform: scale(1.1) rotate(2deg); } }
.bp-m.locked { cursor: default; pointer-events: none; }

/* 送出鈕 */
.bp-submit {
  margin-top: 14px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 800;
  padding: 9px 0;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, #ffd37a, #ffb84d); /* 金色 */
  color: #4a3200;
  cursor: pointer;
  transition: opacity .2s, transform .15s;
}
.bp-submit:hover:not(:disabled) { transform: translateY(-1px); }
.bp-submit:disabled { opacity: .4; cursor: default; }

/* 結果列（英文名，無圓形頭像） */
.bp-results { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.br-row { display: flex; align-items: center; gap: 9px; animation: bp-in .35s both; }
.br-name { width: 56px; flex: none; font-size: 12.5px; font-weight: 700; font-family: var(--font-display); color: var(--bc); }
.br-name .plli { width: 10px; height: 10px; margin-left: 3px; color: var(--bc); }
.br-track { flex: 1; height: 9px; border-radius: 999px; background: var(--line); overflow: hidden; }
.br-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 24%, transparent);
  transition: width .7s cubic-bezier(.2, .8, .2, 1);
}
.br-row.top .br-fill { background: color-mix(in srgb, var(--gold) 75%, transparent); }
.br-row.mine .br-fill { background: linear-gradient(90deg, var(--bc), color-mix(in srgb, var(--bc) 55%, transparent)); }
.br-pct { width: 36px; flex: none; text-align: right; font-family: var(--font-display); font-weight: 700; font-size: 12.5px; }
.bp-foot { font-size: 11.5px; color: var(--ink-dim); margin-top: 10px; }
.bp-foot b, .bp-foot .bp-check { color: var(--bc); }
/* 收合連結：不要吃到預設的連結藍 */
.bp-less { color: var(--ink-dim); text-decoration: none; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.bp-less:hover { color: var(--ink); }
@keyframes bp-in { from { opacity: 0; transform: translateY(6px); } }

/* 已投的摘要態（隔天/重新整理後回訪） */
/* 摘要態：去掉卡片外觀，只保留左縮排讓膠囊跟歌詞文字對齊同一條線 */
#bias-card.mini { padding: 0 0 0 18px; background: none; border: 0; max-width: none; }
.bp-mini {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  padding: 6px 12px 6px 8px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}
.bp-mini .bm-t { font-size: 11.5px; color: var(--ink-dim); }
.bp-mini .bm-t b { color: var(--bc); font-family: var(--font-display); }
.bp-mini .bm-done { font-size: 11px; font-weight: 700; color: var(--bc); } /* ✓ 跟著投的成員色，與展開態一致 */
.bp-mini .bm-more { font-size: 11px; color: var(--ink-dim); opacity: .7; }

/* ---------- 點擊/投票飄出的 PLLI 符號 ---------- */
.float-heart {
  position: fixed;
  z-index: 2000;
  color: var(--gold); /* 預設金色＝逐句愛心的點擊效果；投票愛心雨會另傳成員色蓋過 */
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 0 6px rgba(255, 211, 122, .5));
  animation: heart-rise 2.4s ease-out forwards;
}
.float-heart .plli { display: block; vertical-align: 0; }
@keyframes heart-rise {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(.4); }
  8%   { opacity: 1; transform: translate(-50%, -8px) scale(1.05); }
  14%  { transform: translate(-50%, -14px) scale(.95); }
  75%  { opacity: 1; transform: translate(calc(-50% + var(--dx, 0px)), var(--rise, -110px)) scale(1); }
  88%  { opacity: .9; transform: translate(calc(-50% + var(--dx, 0px)), calc(var(--rise, -110px) - 16px)) scale(1.35); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), calc(var(--rise, -110px) - 24px)) scale(1.8); }
}

/* ---------- 底部小提示（愛心上限等） ---------- */
#social-toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translate(-50%, 8px);
  background: var(--hud-bg);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 2100;
}
#social-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 觸控裝置沒有 hover：目前唱到的那行常駐顯示 */
@media (hover: none) {
  #lyrics li.active .line-social { opacity: .85; }
}

/* 全螢幕歌詞浮層是 active 行的複本：隱藏社交元件 */
#fs-lyrics .line-social, #fs-lyrics .social-drawer { display: none; }

/* ---------- 首頁 hero 第三張：Killing Part 排行卡 ----------
   置換原本的「人氣 #1」小卡，沿用 .hero-card 的尺寸與圓角，
   但不放縮圖，改用成員色的資料卡外觀。 */
.hero-kp {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding: 14px 16px;
  cursor: default;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--bc) 30%, transparent), transparent 70%),
    var(--panel-2);
  border: 1px solid color-mix(in srgb, var(--bc) 30%, var(--line));
}
/* flex 預設會壓縮子項：空間不夠時文字框被壓扁，字就被切掉一半（歌名曾被壓到 8.7px）。
   卡片高度固定，寧可讓內容自己控制在範圍內，也不要被壓變形。 */
.hero-kp > * { flex: none; }
.hero-kp .hero-tag { position: static; align-self: flex-start; }
.kp-song {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  /* 固定一行＋省略號：卡片高度是固定的，歌名換兩行會擠掉下面的內容 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kp-lead { display: flex; align-items: baseline; gap: 9px; }
.kp-lead b {
  font-family: var(--font-display);
  font-size: clamp(21px, 2vw, 27px);
  font-weight: 700;
  color: var(--bc);
  line-height: 1;
}
.kp-pct { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--ink-dim); }
.kp-seg { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--line); }
.kp-seg i { display: block; height: 100%; }
.kp-foot { font-size: 11.5px; color: var(--ink-dim); line-height: 1.4; }
.kp-foot b { font-family: var(--font-display); font-weight: 700; color: var(--ink); }

@media (max-width: 900px) {
  /* 手機的卡片只有 120px 高，省略分布長條換取足夠的行距，字才不會被切 */
  .hero-kp { padding: 11px 13px; gap: 5px; }
  .hero-kp .kp-seg { display: none; }
  .kp-foot { font-size: 10.5px; }
  .kp-song { font-size: 12.5px; }
}
