:root {
  --bg: #0b1020;
  --bg2: #131a33;
  --fg: #eef2ff;
  --muted: #9aa4c7;
  --accent: #6d8bff;
  --accent2: #b06dff;
  --ok: #46d19e;
  --danger: #ff6b8b;
  --card: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Noto Sans KR", Meiryo, sans-serif;
  color: var(--fg);
  background:
    radial-gradient(1200px 800px at 20% -10%, #21306b 0%, transparent 55%),
    radial-gradient(1000px 700px at 100% 0%, #4a2a6e 0%, transparent 50%),
    var(--bg);
  min-height: 100dvh;
}

.app {
  max-width: 680px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.top { text-align: center; margin-top: 8px; }
.brand {
  font-size: 26px;
  letter-spacing: 0.04em;
  margin: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline { color: var(--muted); font-size: 14px; margin: 8px 0 0; }

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 46px 0 20px;
}

.rec-btn {
  position: relative;
  width: 210px;
  height: 210px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.rec-core {
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent2));
  box-shadow: 0 18px 50px rgba(109, 139, 255, 0.45), inset 0 2px 10px rgba(255,255,255,0.25);
  transition: transform 0.15s ease;
}
.rec-btn:active .rec-core { transform: scale(0.96); }

.rec-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.18);
}

.mic { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.rec-btn.recording .rec-core {
  background: linear-gradient(145deg, #ff5c7a, #ff9a5c);
  box-shadow: 0 0 0 rgba(255,92,122,0.7);
  animation: pulse 1.3s infinite;
}
.rec-btn.busy .rec-core { opacity: 0.7; }
.rec-btn.busy { cursor: progress; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,92,122,0.55); }
  70% { box-shadow: 0 0 0 26px rgba(255,92,122,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,92,122,0); }
}

.status { color: var(--muted); margin-top: 22px; font-size: 15px; min-height: 22px; }

.result {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  backdrop-filter: blur(8px);
  animation: rise 0.35s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.result-head { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(109,139,255,0.18);
  border: 1px solid rgba(109,139,255,0.35);
  color: #cdd7ff;
}
.badge-soft { background: rgba(255,255,255,0.06); border-color: var(--border); color: var(--muted); }

.title-ja { font-size: 24px; margin: 2px 0 2px; line-height: 1.3; }
.title-ko { color: var(--muted); margin: 0 0 14px; font-size: 15px; }

.lyrics-bar { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.lang-toggle {
  display: inline-flex;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}
.lang {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
}
.lang.active { background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fff; }

.lyrics {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.9;
  margin: 0;
  max-height: 46dvh;
  overflow-y: auto;
  padding: 4px 2px 8px;
}
.lyrics.empty { color: var(--muted); font-size: 14px; }

.notice { color: var(--muted); font-size: 13px; margin-top: 18px; text-align: center; min-height: 18px; }
.notice.error { color: var(--danger); }

.hidden { display: none; }
