:root {
  --bg: #0b0910;
  --surface: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #fdf7fb;
  --muted: rgba(253, 247, 251, 0.66);
  --dim: rgba(253, 247, 251, 0.42);
  --hot: #ff4d8d;
  --violet: #a05cff;
  --rose: #ff8ec0;
  --ok: #74f4c8;
  --grad: linear-gradient(135deg, #ff4d8d, #a05cff);
  --shadow: 0 20px 56px rgba(0, 0, 0, 0.4);
  --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); overflow-x: hidden; }

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    radial-gradient(120% 80% at 12% -8%, rgba(255, 77, 141, 0.22), transparent 46%),
    radial-gradient(110% 70% at 100% 4%, rgba(160, 92, 255, 0.24), transparent 50%),
    linear-gradient(180deg, #15101f 0%, #0b0910 44%, #07060c 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
h1, h2, p { margin: 0; overflow-wrap: anywhere; }

.app-shell {
  width: min(100%, 460px);
  margin: 0 auto;
  padding: 18px 18px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand, .pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(14px);
  white-space: nowrap;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  min-width: 52px;
  height: 24px;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.pill { padding: 6px 13px; color: var(--muted); font-size: 12px; font-weight: 700; }

/* cards */
.card {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px);
  padding: 26px 22px;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--rose);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(34px, 10vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.lead {
  margin-top: 16px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 500;
}
.lead b { color: var(--text); font-weight: 800; }

.privacy {
  margin-top: 14px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.small-note { margin-top: 12px; color: var(--hot); font-size: 13px; font-weight: 600; }

/* buttons */
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  margin-top: 22px;
  border: 0;
  border-radius: 16px;
  background: var(--grad);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  box-shadow: 0 12px 30px rgba(255, 77, 141, 0.28);
  transition: transform 160ms ease, filter 160ms ease;
}
.primary-button:hover { filter: brightness(1.06); }
.primary-button:active { transform: scale(0.97); }
.primary-button:disabled { filter: grayscale(0.7) opacity(0.55); cursor: not-allowed; box-shadow: none; }

.ghost-button {
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}
.ghost-button:active { transform: scale(0.97); }

.insta-cta { margin-top: 0; font-size: 15px; }
.insta-cta::before {
  content: "";
  width: 17px; height: 17px;
  border-radius: 5px;
  background:
    radial-gradient(circle at 30% 110%, #fdd854 8%, #ff543e 34%, #c837ab 62%, transparent 70%),
    linear-gradient(135deg, #6559ca, #bc318f);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.9);
}

/* recorder */
.recorder { text-align: center; }
.read-line {
  margin: 6px auto 0;
  max-width: 30ch;
  font-size: 19px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.mic-stage {
  position: relative;
  display: grid;
  place-items: center;
  margin: 26px 0 22px;
  height: 180px;
}

.mic-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 77, 141, 0.18), rgba(160, 92, 255, 0.12));
  box-shadow: 0 0 0 2px rgba(255, 142, 192, 0.35), 0 0 40px rgba(255, 77, 141, 0.25);
  transform: scale(1);
  transition: transform 90ms ease, box-shadow 90ms ease;
}
.mic-core {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 999px;
  background: rgba(12, 8, 18, 0.7);
  font-size: 36px;
}

.countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 84px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 8px 32px rgba(255, 77, 141, 0.6);
}

.record-progress {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}
.record-progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--grad);
  transition: width 100ms linear;
}

.status { margin-top: 14px; color: var(--muted); font-size: 14px; font-weight: 600; }

/* result */
.result { text-align: center; }

.gauge-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 6px auto 4px;
}
.gauge { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge-bg { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 9; }
.gauge-fg {
  fill: none;
  stroke: url(#g) var(--hot);
  stroke: var(--hot);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 1100ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.gauge-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
}
.gauge-center strong {
  font-size: 64px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.03em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.gauge-center span { margin-top: 2px; color: var(--muted); font-size: 14px; font-weight: 700; }

.vtype { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; margin-top: 4px; }
.vcomment { margin-top: 10px; color: var(--muted); font-size: 15px; line-height: 1.55; font-weight: 500; }
.vrank {
  display: inline-block;
  margin-top: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 77, 141, 0.14);
  border: 1px solid rgba(255, 142, 192, 0.3);
  color: var(--rose);
  font-size: 13px;
  font-weight: 800;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 22px 0;
}
.stat {
  padding: 14px 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}
.stat-label { display: block; color: var(--dim); font-size: 11px; font-weight: 700; }
.stat-value { display: block; margin-top: 6px; font-size: 15px; font-weight: 800; }

.cta-box { margin-top: 6px; }
.cta-hook {
  margin: 0 auto 14px;
  max-width: 30ch;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.6;
}
.cta-hook b { font-weight: 800; }
.kw {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
}

/* ---------- 결과 발표 연출 ---------- */
#confetti {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 50;
}

/* 게이지 뒤 펄스 글로우 */
.gauge-wrap::before {
  content: "";
  position: absolute;
  inset: -14%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 77, 141, 0.45), transparent 62%);
  filter: blur(8px);
  z-index: -1;
  animation: glowPulse 2s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.45; transform: scale(0.94); }
  50% { opacity: 0.9; transform: scale(1.06); }
}

/* 점수 숫자 착지 펀치 */
.gauge-center strong.pop { animation: scorePop 0.5s cubic-bezier(0.2, 1.4, 0.3, 1) both; }
@keyframes scorePop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* 결과 요소 순차 등장 */
.result.reveal > * { animation: riseIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.result.reveal .eyebrow { animation-delay: 0.02s; }
.result.reveal .gauge-wrap { animation: zoomIn 0.6s cubic-bezier(0.2, 0.9, 0.2, 1.1) both; animation-delay: 0.08s; }
.result.reveal .vtype { animation: bangIn 0.6s cubic-bezier(0.2, 1.5, 0.3, 1) both; animation-delay: 0.62s; }
.result.reveal .vcomment { animation-delay: 0.82s; }
.result.reveal .vrank { animation: bangIn 0.5s cubic-bezier(0.2, 1.5, 0.3, 1) both; animation-delay: 0.96s; }
.result.reveal .stats { animation-delay: 1.06s; }
.result.reveal .cta-box { animation-delay: 1.18s; }

@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.82); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes bangIn {
  0% { opacity: 0; transform: scale(0.5); }
  100% { opacity: 1; transform: scale(1); }
}

/* 점수 반응 헤드라인 */
.reaction {
  font-size: 22px !important;
  font-weight: 900 !important;
  letter-spacing: -0.01em;
  text-transform: none !important;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--rose);
}

.vtype {
  text-shadow: 0 6px 30px rgba(255, 77, 141, 0.35);
}

.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .result.reveal > *,
  .gauge-wrap::before,
  .gauge-center strong.pop { animation: none !important; }
}
