/* SAY@Church 2027 團歌選舉 */

:root {
  --ink: #14120f;
  --ink-soft: #4a443c;
  --muted: #857c70;
  --cream: #faf5ec;
  --paper: #fffdf8;
  --teal: #0b6b5d;
  --teal-deep: #06423a;
  --sun: #f0a03c;
  --coral: #e2553c;
  --line: rgba(20, 18, 15, 0.1);
  --radius: 22px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang HK",
    "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---------- 頂欄 ---------- */
.top {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 22px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand span { color: var(--coral); }
.tag {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px 22px 56px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -120px -8vw auto auto;
  width: 70vw;
  height: 70vw;
  max-width: 760px;
  max-height: 760px;
  background: radial-gradient(circle at 50% 50%, rgba(11,107,93,0.10), transparent 62%);
  pointer-events: none;
  z-index: -1;
}
.eyebrow {
  margin: 0 0 14px;
  font-size: 12.5px;
  letter-spacing: 0.16em;
  color: var(--teal);
  font-weight: 700;
}
h1 {
  margin: 0 0 26px;
  font-size: clamp(46px, 11vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 850;
}
h1 em {
  font-style: normal;
  color: var(--teal);
  position: relative;
  white-space: nowrap;
}
h1 em::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.06em;
  height: 0.09em;
  background: var(--sun);
  border-radius: 4px;
  opacity: 0.85;
}
.intro { max-width: 620px; }
.intro p { margin: 0 0 14px; color: var(--ink-soft); }
.intro .lead {
  font-size: clamp(20px, 3.4vw, 25px);
  line-height: 1.45;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}
.intro strong { color: var(--teal); font-weight: 700; }
.intro .punch {
  color: var(--ink);
  font-weight: 650;
  border-left: 3px solid var(--sun);
  padding-left: 14px;
  margin-top: 20px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 30px 0 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 650;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
  font-family: inherit;
}
.btn:active { transform: translateY(1px) scale(0.995); }
.btn-primary {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(11, 107, 93, 0.8);
}
.btn-primary:hover { background: var(--teal-deep); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: rgba(20, 18, 15, 0.18);
}
.btn-ghost:hover { background: rgba(20, 18, 15, 0.045); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: default; transform: none; }

/* 倒數 */
.countdown {
  display: inline-flex;
  flex-direction: column;
  padding: 16px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}
.cd-label {
  font-size: 11.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 2px;
}
.cd-digits {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.cd-note { font-size: 12.5px; color: var(--muted); }

/* ---------- 區塊 ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 54px 22px;
}
.section-head { margin-bottom: 26px; }
.section-head h2 {
  margin: 0 0 6px;
  font-size: clamp(26px, 4.4vw, 34px);
  letter-spacing: -0.03em;
  font-weight: 800;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.num {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--coral);
  font-weight: 700;
  transform: translateY(-2px);
}
.section-sub { margin: 0; color: var(--muted); max-width: 560px; }

/* ---------- 名字欄 ---------- */
.namebox { margin-bottom: 18px; }
.namebox label {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  margin-bottom: 6px;
}
.namebox label span { font-weight: 400; color: var(--muted); }
.namebox input {
  width: 100%;
  max-width: 380px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(20, 18, 15, 0.16);
  background: var(--paper);
  font: inherit;
  font-size: 15.5px;
  color: inherit;
}
input:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* ---------- 歌卡 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.card:hover { box-shadow: 0 18px 40px -28px rgba(20,18,15,0.5); }

.skeleton {
  height: 380px;
  border-radius: var(--radius);
  background: linear-gradient(100deg, #f2ece0 30%, #f8f4ea 48%, #f2ece0 66%);
  background-size: 220% 100%;
  animation: shimmer 1.4s infinite linear;
}
@keyframes shimmer { to { background-position: -120% 0; } }

.song { display: flex; flex-direction: column; }
.song.voted { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(11,107,93,0.14); }

.song-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #1a1a1a;
  overflow: hidden;
}
.song-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.song-media button.play {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0; padding: 0;
  background: rgba(0, 0, 0, 0.16);
  cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.2s ease;
}
.song-media button.play:hover { background: rgba(0, 0, 0, 0.04); }
.play-icon {
  width: 66px; height: 66px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  transition: transform 0.18s ease;
}
.song-media button.play:hover .play-icon { transform: scale(1.08); }
.play-icon::after {
  content: "";
  width: 0; height: 0;
  border-left: 17px solid var(--ink);
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  margin-left: 5px;
}
.song-media iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.song-num {
  position: absolute; top: 10px; left: 10px;
  background: rgba(20,18,15,0.78);
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 4px 9px;
  border-radius: 99px;
  backdrop-filter: blur(4px);
}

.song-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.song-body h3 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.02em;
  font-weight: 750;
  line-height: 1.3;
}
.artist { margin: 0; font-size: 13px; color: var(--muted); letter-spacing: 0.02em; }
.blurb { margin: 4px 0 6px; font-size: 14.5px; color: var(--ink-soft); line-height: 1.65; flex: 1; }

.vote-btn {
  margin-top: 4px;
  width: 100%;
  padding: 13px 16px;
  border-radius: 13px;
  border: 1px solid var(--teal);
  background: transparent;
  color: var(--teal);
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.vote-btn:hover { background: rgba(11, 107, 93, 0.07); }
.vote-btn.is-voted {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}
.vote-btn[disabled] { opacity: 0.75; cursor: default; }

.fineprint { margin: 16px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- 結果 ---------- */
.section-dark {
  max-width: none;
  background: var(--teal-deep);
  color: #f4f1e8;
  padding: 54px max(22px, calc((100vw - var(--maxw)) / 2 + 22px));
}
.section-dark .section-head h2 { color: #fff; }
.section-dark .section-sub { color: rgba(244, 241, 232, 0.6); }
.section-dark .num { color: var(--sun); }

.results-total {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 22px;
}
.results-total b {
  font-size: clamp(44px, 8vw, 64px);
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.results-total span { color: rgba(244, 241, 232, 0.62); font-size: 14px; }

.bars { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.bar-row { display: grid; gap: 6px; }
.bar-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 15px;
}
.bar-top .nm { font-weight: 650; }
.bar-top .pc { font-variant-numeric: tabular-nums; color: rgba(244,241,232,0.72); font-size: 13.5px; }
.bar-track {
  height: 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.3);
  width: 0;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.bar-row.lead .bar-fill { background: linear-gradient(90deg, #43c9ad, #9ff0dd); }
.bar-row.lead .nm::after {
  content: "領先";
  font-size: 10.5px; letter-spacing: .08em;
  background: rgba(159, 240, 221, .18); color: #9ff0dd;
  padding: 1px 7px; border-radius: 99px; margin-left: 8px;
  vertical-align: 2px;
}
.results-note {
  margin: 24px 0 0;
  font-size: 13.5px;
  color: rgba(244, 241, 232, 0.55);
  max-width: 620px;
}

/* ---------- 表單 ---------- */
.form { padding: 24px; display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  margin-bottom: 6px;
}
.field label span { font-weight: 400; color: var(--muted); }
.field label b { color: var(--coral); }
.field input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid rgba(20, 18, 15, 0.16);
  background: #fff;
  font: inherit;
  font-size: 15.5px;
  color: inherit;
}
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.form-note { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* ---------- 頁腳 ---------- */
.foot {
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding: 40px 22px 56px;
}
.foot-in { max-width: var(--maxw); margin: 0 auto; }
.foot-brand { font-weight: 800; font-size: 18px; margin-bottom: 14px; }
.foot-brand span { color: var(--coral); }
.foot ul { margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: 14px; }
.foot li { margin-bottom: 4px; }
.foot-note {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
  background: rgba(20, 18, 15, 0.03);
  border-radius: 12px;
  padding: 12px 14px;
  max-width: 560px;
}
.admin-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dashed rgba(20,18,15,0.22);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 140%);
  background: var(--ink);
  color: #fff;
  padding: 13px 20px;
  border-radius: 14px;
  font-size: 14.5px;
  max-width: min(92vw, 460px);
  text-align: center;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.6);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 60;
}
.toast.show { opacity: 1; }
.toast.show { transform: translate(-50%, 0); }
.toast b { color: var(--sun); letter-spacing: 0.08em; }

.ts-slot { display: flex; justify-content: flex-start; min-height: 0; }

/* ---------- 已截止 ---------- */
.closed-banner {
  background: rgba(226, 85, 60, 0.09);
  border: 1px solid rgba(226, 85, 60, 0.24);
  color: #8a2d1c;
  padding: 13px 16px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding-top: 18px; }
  .section { padding: 42px 18px; }
  .countdown { width: 100%; }
  .cd-digits { font-size: 23px; }
  .toast { bottom: 14px; }
}
