/* 옹알옹알 흥얼흥얼 — 아동용 캔디 테마 */
:root {
  --bg: #fff7fb;
  --surface: #ffffff;
  --pink: #ff4f9a;
  --pink-soft: #ffe3f0;
  --blue: #4fa3ff;
  --green: #35c77b;
  --text: #333a4d;
  --dim: #8b93a7;
  --border: #ffd6e8;
  --shadow: 0 6px 18px rgba(255, 79, 154, .14);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', system-ui, sans-serif;
  min-height: 100vh;
}
.view { display: none; min-height: 100vh; }
.view.active { display: block; }

/* topbar */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  position: sticky; top: 0;
  background: var(--bg);
  z-index: 10;
}
.logo { font-weight: 700; font-size: 17px; }
.topbar span:not(.logo) { font-weight: 700; font-size: 17px; }
.back-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: none; background: var(--pink-soft); color: var(--pink);
  font-size: 18px; cursor: pointer;
}
.name-input {
  flex: 1; max-width: 300px;
  border: 2px solid var(--border); border-radius: 12px;
  padding: 8px 12px; font-size: 15px; font-family: inherit;
}
.pill-btn {
  border: none; border-radius: 999px; cursor: pointer;
  background: var(--pink); color: #fff;
  padding: 9px 16px; font-size: 14px; font-family: inherit;
}
.pill-btn.danger { background: #ffb1c9; }

/* home */
.home-hero { text-align: center; margin-top: 34px; }
.bubble {
  font-size: 54px; display: inline-block;
  animation: bounce 2.2s ease-in-out infinite;
}
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
h1 { font-size: 30px; letter-spacing: -0.5px; margin-top: 6px; }
.tagline { color: var(--dim); margin-top: 12px; line-height: 1.6; font-size: 15px; }

.home-actions {
  display: grid; gap: 14px;
  max-width: 380px; margin: 30px auto 0; padding: 0 20px;
}
.big-btn {
  display: flex; align-items: center; gap: 14px;
  border: none; border-radius: 18px; cursor: pointer;
  padding: 20px 22px; font-size: 18px; font-weight: 700;
  font-family: inherit; color: #fff;
  box-shadow: var(--shadow);
  transition: transform .15s;
}
.big-btn:hover { transform: translateY(-2px) scale(1.01); }
.big-btn span { font-weight: 700; }
.big-btn.pink { background: linear-gradient(135deg, #ff6fb0, #ff4f9a); }
.big-btn.blue { background: linear-gradient(135deg, #63b0ff, #4fa3ff); }
.big-btn.green { background: linear-gradient(135deg, #4fd68e, #35c77b); }

.soft-error {
  max-width: 400px; margin: 18px auto 0; padding: 12px 16px;
  background: #fff0f0; color: #d43c5c;
  border-radius: 12px; font-size: 14px; text-align: center;
}

/* record */
.record-stage { text-align: center; padding-top: 40px; }
.hint { color: var(--dim); line-height: 1.7; margin-bottom: 26px; }
.rec-btn {
  width: 110px; height: 110px; border-radius: 50%;
  border: 6px solid var(--pink-soft); background: var(--pink);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s;
}
.rec-btn:active { transform: scale(.94); }
.rec-dot {
  width: 42px; height: 42px; border-radius: 50%; background: #fff;
  transition: all .25s;
}
.rec-btn.recording { background: #ff2d55; animation: pulse 1.2s infinite; }
.rec-btn.recording .rec-dot { width: 34px; height: 34px; border-radius: 8px; background: #ffe3f0; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,45,85,.35); } 50% { box-shadow: 0 0 0 22px rgba(255,45,85,0); } }

.meter {
  display: flex; gap: 5px; justify-content: center; align-items: flex-end;
  height: 44px; margin-top: 28px;
}
.meter i {
  width: 12px; height: 8px; border-radius: 6px 6px 0 0;
  background: var(--pink-soft); transition: height .08s;
}
.meter i.on { background: var(--pink); }
.rec-time { margin-top: 14px; font-size: 24px; font-weight: 700; color: var(--pink); }

/* analyzing */
.analyze-stage { text-align: center; padding-top: 120px; }
.bouncer { font-size: 60px; animation: bounce 1.4s ease-in-out infinite; }
#analyze-msg { margin: 18px 0; color: var(--dim); }
progress { width: min(320px, 80vw); accent-color: var(--pink); height: 14px; }

/* sing-along */
.sing-body { max-width: 860px; margin: 0 auto; padding: 0 16px 40px; }
#roll-canvas {
  width: 100%; height: 220px;
  border: 3px solid var(--border); border-radius: 16px;
  display: block;
}
.now-note {
  text-align: center; margin-top: 14px;
  font-size: 46px; font-weight: 800; color: var(--dim);
}
.now-note .lit { color: var(--pink); text-shadow: 0 0 18px rgba(255,79,154,.4); }
.now-note small { display: block; font-size: 13px; color: var(--dim); font-weight: 400; }
.play-row {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin: 14px 0;
}
.round-btn {
  width: 64px; height: 64px; border-radius: 50%;
  border: none; background: var(--pink); color: #fff;
  font-size: 24px; cursor: pointer; box-shadow: var(--shadow);
}
.round-btn.playing { background: var(--green); }
.sheet-toggle { color: var(--dim); font-size: 14px; user-select: none; }
.sheet-wrap {
  margin-top: 10px;
  background: #fff; border: 2px solid var(--border); border-radius: 14px;
  overflow-x: auto; min-height: 90px;
}
#osmd-box svg { max-width: none !important; }
.hint-line { text-align: center; color: var(--dim); font-size: 13px; margin-top: 16px; }

/* library */
.lib-list {
  list-style: none; max-width: 480px; margin: 10px auto; padding: 0 16px;
  display: grid; gap: 12px;
}
.lib-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 2px solid var(--border);
  border-radius: 16px; padding: 14px 16px;
}
.lib-info { flex: 1; min-width: 0; }
.lib-info b { display: block; margin-bottom: 3px; }
.lib-info small { color: var(--dim); font-size: 12.5px; }
.empty-note {
  text-align: center; color: var(--dim); margin-top: 70px; line-height: 1.8;
}

@media (max-width: 520px) {
  h1 { font-size: 25px; }
  .now-note { font-size: 36px; }
}
