/* ============================================================
   Song Face-Off — public vote page · AI Studio
   Dark aurora stage · glass cards · gradient type · 3D flips
   ============================================================ */

:root {
  --bg0: #08080f;
  --bg1: #0d0b1a;
  --ink: #f5f5fc;
  --dim: #a7a7c2;
  --line: rgba(255, 255, 255, 0.09);
  --glass: rgba(255, 255, 255, 0.045);
  --glass-2: rgba(255, 255, 255, 0.07);
  --rose: #f43f5e;
  --violet: #a855f7;
  --sky: #38bdf8;
  --gold: #fbbf24;
  --green: #34d399;
  --radius: 22px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(168, 85, 247, 0.14), transparent 60%),
    radial-gradient(1000px 600px at -10% 20%, rgba(244, 63, 94, 0.12), transparent 55%),
    linear-gradient(180deg, var(--bg1), var(--bg0) 45%);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- aurora orbs ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  animation: drift 26s ease-in-out infinite alternate;
}
.o1 { width: 46vmax; height: 46vmax; left: -12vmax; top: -14vmax; background: rgba(244, 63, 94, 0.20); }
.o2 { width: 38vmax; height: 38vmax; right: -10vmax; top: 18vh; background: rgba(168, 85, 247, 0.18); animation-delay: -8s; }
.o3 { width: 34vmax; height: 34vmax; left: 24vw; bottom: -16vmax; background: rgba(56, 189, 248, 0.14); animation-delay: -16s; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(4vmax, 3vmax, 0) scale(1.12); }
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(10, 10, 20, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand b { font-weight: 800; }
.brand-emoji { font-size: 1.15rem; }
.brand-chip {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
  transition: transform 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.brand-chip:hover { background: rgba(251, 191, 36, 0.16); transform: translateY(-1px); }

/* ---------- shared type ---------- */
main { max-width: 1160px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }

.kicker {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 14px;
}
.kicker.gold { color: var(--gold); }

.hero { padding: clamp(36px, 7vw, 72px) 0 clamp(28px, 5vw, 48px); text-align: center; }

.title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 6.2vw, 4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.grad {
  background: linear-gradient(90deg, var(--rose), var(--violet) 45%, var(--sky));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: slide-hue 7s ease-in-out infinite alternate;
}
@keyframes slide-hue {
  from { background-position: 0% 0; }
  to   { background-position: 100% 0; }
}

.lede {
  color: var(--dim);
  font-size: clamp(0.98rem, 2.4vw, 1.13rem);
  max-width: 620px;
  margin: 0 auto 10px;
}
.lede b { color: var(--ink); }

.close-note { color: var(--dim); font-size: 0.9rem; margin-bottom: 22px; }
.close-note b { color: var(--ink); }

.total-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  font-size: 0.92rem;
  color: var(--dim);
  margin-bottom: 30px;
}
.total-pill b { color: var(--ink); font-size: 1.05rem; font-family: var(--font-display); }
.total-pill .live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ---------- poll cards ---------- */
.pill-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}
.pill-row .total-pill { margin-bottom: 0; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid rgba(217, 70, 239, 0.4);
  background: rgba(217, 70, 239, 0.1);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  font-family: var(--font-body);
  transition: transform 0.15s ease, background 0.15s ease;
}
.share-btn:hover { transform: translateY(-1px); background: rgba(217, 70, 239, 0.2); }
.after-share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin-left: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(217, 70, 239, 0.4);
  background: rgba(217, 70, 239, 0.12);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
}
.after-share:hover { background: rgba(217, 70, 239, 0.22); }
/* ---------- share sheet ---------- */
.share-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(5, 5, 12, 0.64);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.share-backdrop[hidden] { display: none; }
@media (min-width: 640px) { .share-backdrop { align-items: center; padding: 20px; } }
.share-sheet {
  width: 100%;
  max-width: 430px;
  background: linear-gradient(180deg, #17172c, #101020);
  border: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  padding: 18px 18px 22px;
  box-shadow: var(--shadow);
  animation: sheet-up 0.28s cubic-bezier(0.2, 0.7, 0.3, 1);
}
@media (min-width: 640px) { .share-sheet { border-radius: 22px; } }
@keyframes sheet-up {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.share-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 4px;
}
.share-close {
  background: none;
  border: 1px solid var(--line);
  color: var(--dim);
  border-radius: 10px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 0.95rem;
}
.share-close:hover { color: var(--ink); background: var(--glass-2); }
.share-link {
  color: var(--dim);
  font-size: 0.85rem;
  margin-bottom: 14px;
  word-break: break-all;
}
.share-rows { display: grid; gap: 8px; }
.share-target {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, transform 0.15s ease;
}
.share-target:hover { background: var(--glass-2); transform: translateX(2px); }
.share-target[hidden] { display: none; }
.share-ic {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c, #555);
  color: #fff;
  font-weight: 800;
  font-size: 0.92rem;
  flex: 0 0 34px;
}
.poll-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  text-align: left;
}
@media (min-width: 720px) {
  .poll-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .poll-grid .vs {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
  }
}
.poll-grid .vs {
  display: none;
  align-items: center;
  justify-content: center;
  width: 58px; height: 58px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #1c1c2e, #101020);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
@media (min-width: 720px) { .poll-grid .vs { display: flex; } }
.vs-row { display: flex; justify-content: center; margin: 4px 0; }
.vs-row .vs { display: flex; }

.option-card {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, border-color 0.25s ease;
  padding-bottom: 18px;
}
.option-card:hover { transform: translateY(-3px); }
.option-card.mine { border-color: rgba(52, 211, 153, 0.55); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(52, 211, 153, 0.35), 0 0 42px rgba(52, 211, 153, 0.12); }

.media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #14142a, #0c0c18);
  overflow: hidden;
}
.media img, .media iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border: 0;
}
.media .yt-thumb { filter: saturate(1.08); }
.media .play-badge {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 66px; height: 46px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  transition: transform 0.18s ease, background 0.18s ease;
}
.yt-launch:hover .play-badge,
.yt-launch:focus-visible .play-badge { transform: translate(-50%, -50%) scale(1.1); background: rgba(244, 63, 94, 0.85); }
.yt-launch {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  background: transparent;
  border: 0; cursor: pointer;
  padding: 0;
}
.media-soon {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--dim);
  font-size: 0.95rem;
  font-weight: 600;
  background:
    radial-gradient(400px 200px at 50% 0%, rgba(168, 85, 247, 0.14), transparent 70%),
    linear-gradient(135deg, #14142a, #0c0c18);
}
.media-soon .big { font-size: 2.2rem; }

.crown {
  position: absolute;
  top: 10px; left: 12px;
  z-index: 2;
  font-size: 1.35rem;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.6));
  animation: crown-in 0.5s cubic-bezier(0.2, 0.8, 0.3, 1.2);
}
@keyframes crown-in { from { transform: scale(0) rotate(-20deg); } to { transform: scale(1) rotate(0); } }

.opt-body { padding: 16px 18px 0; }
.opt-name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.opt-tag { color: var(--dim); font-size: 0.92rem; margin-top: 3px; }

.voted-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #052e1c;
  background: var(--green);
  padding: 4px 12px;
  border-radius: 999px;
}

.opt-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 14px 0 6px;
  font-size: 0.92rem;
  color: var(--dim);
}
.opt-meta b { color: var(--ink); font-family: var(--font-display); font-size: 1.12rem; }
.opt-meta .share { font-weight: 700; color: var(--ink); }

.bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rose), var(--violet));
  transition: width 0.9s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.vote-btn {
  display: block;
  width: calc(100% - 36px);
  margin: 16px auto 0;
  padding: 14px 18px;
  border: 0;
  border-radius: 14px;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--rose), #d946ef);
  box-shadow: 0 12px 30px rgba(217, 70, 239, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.vote-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(217, 70, 239, 0.4); }
.vote-btn:active { transform: translateY(0) scale(0.985); }
.vote-btn:disabled { filter: grayscale(0.7) brightness(0.75); cursor: default; transform: none; box-shadow: none; }

.after-note {
  margin-top: 22px;
  color: var(--dim);
  font-size: 0.95rem;
  min-height: 1.4em;
}
.after-note b { color: var(--ink); }

.closed-banner {
  margin: 0 auto 26px;
  max-width: 560px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
  font-size: 0.95rem;
  color: var(--ink);
}

.loading { color: var(--dim); padding: 40px 0; display: flex; align-items: center; justify-content: center; gap: 10px; }
.spinner {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--violet);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- AI Studio showcase ---------- */
.studio {
  text-align: center;
  padding: clamp(48px, 8vw, 90px) 0 clamp(40px, 6vw, 64px);
  border-top: 1px solid var(--line);
  margin-top: clamp(28px, 5vw, 56px);
}
.studio-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6.5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 14px;
}
.grad-ai {
  background: linear-gradient(90deg, #fbbf24, #f43f5e 40%, #a855f7 75%, #38bdf8);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: slide-hue 8s ease-in-out infinite alternate;
}
.studio .lede { margin-bottom: 34px; }

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  text-align: left;
}
@media (min-width: 540px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .cards { grid-template-columns: repeat(4, 1fr); } }

.flip {
  perspective: 1400px;
  aspect-ratio: 4 / 5;
  outline: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.flip:focus-visible .face { box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.7); }
.flip-inner {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.flip.is-flipped .flip-inner { transform: rotateY(180deg); }

.face {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  border: 1px solid var(--line);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: hidden;
}
.face.front {
  background:
    radial-gradient(140% 110% at 20% 0%, rgba(255, 255, 255, 0.22), transparent 45%),
    linear-gradient(150deg, var(--g1), var(--g2));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
}
.face.front .emoji { font-size: clamp(2.6rem, 7vw, 3.4rem); filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35)); }
.face.front .name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.15rem, 3.2vw, 1.35rem);
  letter-spacing: -0.01em;
  margin-top: 12px;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  text-align: center;
}
.face.front .hint {
  margin-top: 14px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  padding: 6px 13px;
  background: rgba(0, 0, 0, 0.18);
}
.soon-badge {
  position: absolute;
  top: 12px; right: 12px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1b2b0f;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 4px 10px;
}

.face.back {
  transform: rotateY(180deg);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  justify-content: flex-start;
  gap: 10px;
}
.back-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.02rem;
}
.face.back ul { list-style: none; display: grid; gap: 9px; }
.face.back li {
  position: relative;
  padding-left: 24px;
  font-size: 0.86rem;
  color: #d9d9ec;
}
.face.back li::before {
  content: "✓";
  position: absolute;
  left: 2px;
  top: 0;
  color: var(--green);
  font-weight: 800;
}
.chip {
  margin-top: auto;
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.08);
  border-radius: 999px;
  padding: 5px 11px;
}

.cta {
  display: inline-block;
  margin-top: 36px;
  padding: 15px 30px;
  border-radius: 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #fbbf24, #f43f5e 60%, #d946ef);
  box-shadow: 0 14px 36px rgba(244, 63, 94, 0.32);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 18px 44px rgba(244, 63, 94, 0.45); }

.cta-soon {
  margin-top: 34px;
  display: inline-block;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--dim);
  font-size: 0.95rem;
}

/* ---------- footer ---------- */
.foot {
  text-align: center;
  color: var(--dim);
  font-size: 0.88rem;
  padding: 30px 16px 40px;
  border-top: 1px solid var(--line);
}
.foot b { color: var(--ink); }

/* ---------- confetti ---------- */
#confetti {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .bar i { transition: width 0.01s; }
}

/* ---------- small screens ---------- */
@media (max-width: 400px) {
  .opt-name { font-size: 1.25rem; }
  .vote-btn { font-size: 0.95rem; }
}
