/* 그 노래 뭐였지? — 가사로 노래 찾기 (단독 공개 사이트) */
:root {
  --bg: #08070c;
  --bg-2: #0c0a11;
  --panel: rgba(255, 255, 255, .026);
  --panel-line: rgba(255, 255, 255, .085);
  --line-soft: rgba(255, 255, 255, .07);
  --pink: #ff2d95;
  --pink-2: #ff7ab8;
  --pink-3: #ffa8d0;
  --pink-rgb: 255, 45, 149;
  --text: #f6eff5;
  --text-2: #d3c8d8;
  --text-3: #9d92a8;
  --text-4: #7b7186;
  --radius: 18px;
  --fs: 1;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.glow {
  position: fixed;
  inset: 0 0 auto 0;
  height: 520px;
  pointer-events: none;
  background:
    radial-gradient(60% 80% at 82% -10%, rgba(var(--pink-rgb), .20), transparent 62%),
    radial-gradient(50% 70% at 8% 0%, rgba(120, 70, 255, .14), transparent 60%);
  z-index: 0;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 10px 14px;
  background: var(--pink);
  color: #fff;
  border-radius: 0 0 10px 0;
  z-index: 20;
}
.skip:focus { left: 0; }

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 34px 16px 44px;
}

/* ── 머리글 ───────────────────────────── */
.hero { padding: 10px 2px 22px; }

.kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--pink-2);
}

.hero h1 {
  margin: 0 0 10px;
  font-family: "Gowun Dodum", "Pretendard Variable", Pretendard, sans-serif;
  font-size: clamp(27px, 7.4vw, 40px);
  line-height: 1.28;
  font-weight: 400;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
  background: linear-gradient(100deg, #fff 12%, var(--pink-3) 62%, var(--pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--pink-3);
}

.lede {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.72;
  color: var(--text-3);
  overflow-wrap: anywhere;
  word-break: keep-all;
}
.lede b { color: var(--pink-3); font-weight: 600; }

/* ── 패널 ─────────────────────────────── */
.panel {
  margin: 0 0 16px;
  padding: 16px;
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .014));
  box-shadow: 0 18px 44px -30px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(6px);
}

/* ── 입력 ─────────────────────────────── */
.field { display: block; }

.field-label {
  display: block;
  margin: 0 0 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.field-label em {
  margin-left: 6px;
  font-style: normal;
  font-weight: 400;
  color: var(--text-4);
  letter-spacing: 0;
}

#q {
  display: block;
  width: 100%;
  min-height: 74px;
  padding: 12px 13px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 13px;
  background: rgba(6, 5, 10, .72);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.62;
  letter-spacing: -.01em;
  resize: vertical;
  transition: border-color .18s ease, box-shadow .18s ease;
}
#q::placeholder { color: #6d6379; }
#q:focus {
  outline: none;
  border-color: rgba(var(--pink-rgb), .62);
  box-shadow: 0 0 0 3px rgba(var(--pink-rgb), .16);
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
}

.btn-find {
  flex: 0 0 auto;
  padding: 11px 20px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(120deg, #ff2d95, #ff5fae);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.01em;
  cursor: pointer;
  box-shadow: 0 9px 20px -16px rgba(var(--pink-rgb), .95);
  transition: transform .14s ease, box-shadow .18s ease, opacity .18s ease;
}
.btn-find:hover { box-shadow: 0 11px 24px -14px rgba(var(--pink-rgb), 1); }
.btn-find:active { transform: translateY(1px); }
.btn-find:disabled { opacity: .62; cursor: progress; }
.btn-find:focus-visible { outline: 2px solid var(--pink-3); outline-offset: 2px; }

.btn-clear {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 50%;
  background: rgba(255, 255, 255, .03);
  color: var(--text-3);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.btn-clear:hover { color: var(--pink-3); border-color: rgba(var(--pink-rgb), .45); background: rgba(var(--pink-rgb), .1); }
.btn-clear:disabled { opacity: .45; cursor: default; }

.count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--pink-3);
  white-space: nowrap;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
}

.chip {
  max-width: 100%;
  padding: 6px 11px;
  border: 1px dashed rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: transparent;
  color: var(--text-3);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.chip:hover {
  color: var(--pink-3);
  border-color: rgba(var(--pink-rgb), .5);
  border-style: solid;
  background: rgba(var(--pink-rgb), .08);
}
.chip:focus-visible { outline: 2px solid var(--pink-3); outline-offset: 2px; }

.hint {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.62;
  color: var(--text-4);
  overflow-wrap: anywhere;
  word-break: keep-all;
}

/* ── 알림 · 빈 상태 ───────────────────── */
.note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(var(--pink-rgb), .09);
  box-shadow: inset 0 0 0 1px rgba(var(--pink-rgb), .2);
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.62;
  overflow-wrap: anywhere;
}
.note[hidden] { display: none; }

.idle {
  display: grid;
  gap: 6px;
  place-items: center;
  margin: 14px 0 0;
  padding: 26px 12px;
  border: 1px dashed rgba(255, 255, 255, .1);
  border-radius: 14px;
  text-align: center;
  color: var(--text-4);
  font-size: 12.5px;
  line-height: 1.6;
}
.idle p { margin: 0; }
.idle b { color: var(--pink-3); font-weight: 600; }
.idle-ico {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(var(--pink-rgb), .12);
  color: var(--pink-2);
  font-size: 17px;
}
.idle--small { margin-top: 10px; padding: 18px 12px; }
.idle[hidden] { display: none; }

/* ── 결과 카드 ────────────────────────── */
.results {
  display: grid;
  gap: 9px;
  margin: 12px 0 0;
}
.results:empty { display: none; }

.card {
  display: flex;
  gap: 11px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, .024);
  transition: border-color .18s ease, background .18s ease;
}
@media (hover: hover) {
  .card:hover { border-color: rgba(var(--pink-rgb), .24); background: rgba(255, 255, 255, .036); }
}
.card.is-guess {
  border-color: rgba(var(--pink-rgb), .3);
  background: rgba(var(--pink-rgb), .055);
}

.art {
  flex: 0 0 auto;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 11px;
  background: linear-gradient(140deg, rgba(var(--pink-rgb), .26), rgba(120, 70, 255, .2));
  color: var(--pink-3);
  font-size: 21px;
  line-height: 1;
}
.art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.info {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 2px;
}

.head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.badge {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(var(--pink-rgb), .16);
  box-shadow: inset 0 0 0 1px rgba(var(--pink-rgb), .42);
  color: var(--pink-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
}

.title {
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  overflow-wrap: anywhere;
}

.sub,
.alt,
.heard {
  min-width: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-3);
  overflow-wrap: anywhere;
}
.alt, .heard { font-size: 11.5px; color: var(--text-4); }
.why {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--pink-3);
  overflow-wrap: anywhere;
}

.acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  min-width: 0;
}

.go {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.go:hover {
  color: var(--pink-3);
  border-color: rgba(var(--pink-rgb), .5);
  background: rgba(var(--pink-rgb), .1);
}
.go:focus-visible { outline: 2px solid var(--pink-3); outline-offset: 2px; }
.go .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .8;
}
.go[data-p="appleMusic"] { border-color: rgba(250, 88, 106, .38); color: #ff9aa6; }
.go[data-p="appleMusic"] .dot { background: #fa586a; opacity: 1; }
.go[data-p="youtube"] { border-color: rgba(255, 68, 68, .38); color: #ff9b9b; }
.go[data-p="youtube"] .dot { background: #ff4444; opacity: 1; }
.go[data-p="youtubeMusic"] { border-color: rgba(255, 68, 68, .28); color: #ffb8b8; }
.go[data-p="youtubeMusic"] .dot { background: #ff4444; opacity: .55; }
.go[data-p="deezer"] { border-color: rgba(160, 120, 255, .38); color: #c3adff; }
.go[data-p="deezer"] .dot { background: #a078ff; opacity: 1; }

.save {
  margin-left: auto;
  flex: 0 0 auto;
  padding: 6px 11px;
  border: 1px dashed rgba(var(--pink-rgb), .5);
  border-radius: 999px;
  background: rgba(var(--pink-rgb), .12);
  color: var(--pink-2);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.save:hover { background: rgba(var(--pink-rgb), .2); }
.save.is-on {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, .07);
  color: var(--text-4);
  cursor: default;
}
.save:focus-visible { outline: 2px solid var(--pink-3); outline-offset: 2px; }

.del {
  margin-left: auto;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 999px;
  background: transparent;
  color: var(--text-4);
  font-family: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.del:hover { color: #ff9aa6; border-color: rgba(250, 88, 106, .5); background: rgba(250, 88, 106, .1); }
.del:focus-visible { outline: 2px solid var(--pink-3); outline-offset: 2px; }

.loading {
  margin: 0;
  padding: 20px 12px;
  border: 1px dashed rgba(255, 255, 255, .1);
  border-radius: 14px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-3);
}

/* ── 담은 곡 ──────────────────────────── */
.shelf-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.shelf-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
.shelf-head h2 em {
  margin-left: 4px;
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--text-4);
}
.shelf-head .count { margin-left: auto; }
.shelf-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.62;
  color: var(--text-4);
  overflow-wrap: anywhere;
  word-break: keep-all;
}
.shelf-hint b { color: var(--pink-3); font-weight: 600; }

/* ── 푸터 ─────────────────────────────── */
.foot {
  margin-top: 26px;
  padding: 18px 2px 0;
  border-top: 1px solid var(--line-soft);
  text-align: center;
}
.made {
  margin: 0 0 6px;
  font-size: 12.5px;
  color: var(--text-3);
}
.made a {
  color: var(--pink-2);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(var(--pink-rgb), .38);
  padding-bottom: 1px;
}
.made a:hover { color: var(--pink-3); border-bottom-color: var(--pink-3); }
.fine {
  margin: 0;
  font-size: 11px;
  line-height: 1.66;
  color: #655b70;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

/* ── 토스트 ───────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 14px);
  max-width: min(88vw, 420px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(24, 18, 30, .96);
  box-shadow: 0 10px 30px -12px #000, inset 0 0 0 1px rgba(var(--pink-rgb), .3);
  color: var(--text-2);
  font-size: 12.5px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 30;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ── 좁은 화면 ────────────────────────── */
@media (max-width: 420px) {
  .wrap { padding: 26px 13px 38px; }
  .panel { padding: 13px; border-radius: 16px; }
  .art { width: 58px; height: 58px; border-radius: 10px; }
  .card { padding: 10px; gap: 9px; }
  .btn-find { flex: 1 1 auto; }
  .bar .count { margin-left: 0; flex: 0 0 100%; order: 3; text-align: right; }
  .shelf-head .count { flex: 0 0 auto; }
  .chips { gap: 5px; }
  .chip { font-size: 11.5px; padding: 5px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; }
}
