:root {
  --peach: #ff8fab;
  --peach-deep: #ff5c8a;
  --peach-soft: #ffe0e9;
  --cream: #fff7f2;
  --ink: #3d2c2e;
  --muted: #8a6e72;
  --mint: #5ecfba;
  --mint-deep: #2bb39a;
  --mint-soft: #d8f5ef;
  --panel: rgba(255, 255, 255, 0.82);
  --shadow: 0 12px 36px rgba(255, 92, 138, 0.18);
  --accent: var(--peach);
  --accent-deep: var(--peach-deep);
  --accent-soft: var(--peach-soft);
  --font-display: "Fredoka", "ZCOOL KuaiLe", system-ui, sans-serif;
  --font-cn: "ZCOOL KuaiLe", "Fredoka", system-ui, sans-serif;
}

[data-theme="mint"] {
  --accent: var(--mint);
  --accent-deep: var(--mint-deep);
  --accent-soft: var(--mint-soft);
  --shadow: 0 12px 36px rgba(43, 179, 154, 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body.embed-body {
  background: transparent;
  font-family: var(--font-display);
  color: var(--ink);
}

body.landing-body {
  min-height: 100vh;
  font-family: var(--font-display);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 60% at 15% 20%, var(--accent-soft), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 80%, #ffe8c8, transparent 50%),
    linear-gradient(165deg, var(--cream) 0%, #fff 45%, var(--accent-soft) 100%);
}

/* —— Embed player —— */
.mochi {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 140px;
  padding: 14px 16px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.mochi::before {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--accent-soft);
  opacity: 0.55;
  pointer-events: none;
}

.mochi-cover-wrap {
  flex: 0 0 96px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(145deg, var(--accent), #fff);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 1;
}

.mochi-cover {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-soft);
  display: block;
  transition: transform 0.4s ease, opacity 0.28s ease;
}

.mochi.is-playing .mochi-cover {
  animation: spin-cover 8s linear infinite;
}

.mochi.is-loading {
  pointer-events: none;
}

.mochi.is-loading .mochi-cover-wrap::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: mochi-shimmer 1.05s ease-in-out infinite;
  pointer-events: none;
}

.mochi.is-swap .mochi-title,
.mochi.is-swap .mochi-artist {
  opacity: 0.4;
  transform: translateY(2px);
}

.mochi-title,
.mochi-artist {
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.mochi-nav {
  transition: transform 0.15s ease, filter 0.15s ease;
}

.mochi-nav:active {
  transform: scale(0.92);
}

@keyframes mochi-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .mochi.is-playing .mochi-cover { animation: none; }
  .mochi.is-loading .mochi-cover-wrap::after { animation: none; }
  .mochi-title, .mochi-artist, .mochi-cover { transition: none; }
}

@keyframes spin-cover {
  to {
    transform: rotate(360deg);
  }
}

.mochi-main {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mochi-brand {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--accent-deep);
  font-weight: 600;
  opacity: 0.9;
}

.mochi-title {
  font-family: var(--font-cn);
  font-size: 18px;
  line-height: 1.25;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mochi-artist {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mochi-meta {
  margin: 2px 0 6px;
  font-size: 11px;
  color: var(--muted);
  opacity: 0.92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mochi-meta:empty {
  display: none;
}

.mochi-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mochi-nav {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: var(--accent-soft);
  color: var(--accent-deep);
  display: grid;
  place-items: center;
  padding: 0;
}

.mochi-nav:hover {
  filter: brightness(0.97);
}

.mochi-nav svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.mochi-nav[hidden] {
  display: none !important;
}

.mochi-play {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: linear-gradient(160deg, var(--accent), var(--accent-deep));
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mochi-play:hover {
  transform: scale(1.06);
}

.mochi-play:active {
  transform: scale(0.9);
}

.mochi-play svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.mochi-play .icon-pause {
  display: none;
}

.mochi.is-playing .mochi-play .icon-play {
  display: none;
}

.mochi.is-playing .mochi-play .icon-pause {
  display: block;
}

.mochi-progress {
  flex: 1;
  height: 8px;
  border-radius: 99px;
  background: var(--accent-soft);
  appearance: none;
  outline: none;
  cursor: pointer;
}

.mochi-progress::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-deep);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease;
}

.mochi-progress:active::-webkit-slider-thumb {
  transform: scale(1.2);
}

.mochi-progress::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-deep);
  border: 2px solid #fff;
}

.mochi-time {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 78px;
  text-align: right;
}

.mochi-status {
  font-size: 12px;
  color: var(--muted);
  min-height: 1.2em;
}

.mochi-status.is-error {
  color: #d6455d;
}

.mochi-ears {
  position: absolute;
  top: 8px;
  right: 14px;
  font-size: 16px;
  opacity: 0.55;
  pointer-events: none;
  z-index: 1;
}

/* —— Landing —— */
.landing {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px 72px;
}

.landing-hero {
  text-align: center;
  margin-bottom: 36px;
}

.landing-brand {
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  font-family: var(--font-cn);
  margin: 0 0 8px;
  background: linear-gradient(120deg, var(--accent-deep), #ffb347);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.02em;
}

[data-theme="mint"] .landing-brand {
  background: linear-gradient(120deg, var(--mint-deep), #7ed6c2);
  -webkit-background-clip: text;
  background-clip: text;
}

.landing-sub {
  margin: 0;
  font-size: 1.05rem;
  color: var(--muted);
}

.landing-preview {
  margin: 0 auto 40px;
  max-width: 420px;
}

.landing-preview .mochi {
  min-height: 160px;
}

.panel {
  background: rgba(255, 255, 255, 0.72);
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  padding: 22px 22px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.panel h2 {
  font-family: var(--font-cn);
  font-size: 1.25rem;
  margin: 0 0 14px;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.field-row input[type="text"] {
  flex: 1 1 220px;
  border: 2px solid var(--accent-soft);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.field-row input[type="text"]:focus {
  border-color: var(--accent);
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  background: linear-gradient(160deg, var(--accent), var(--accent-deep));
  color: #fff;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn:hover {
  transform: translateY(-1px) scale(1.02);
}

.btn:active {
  transform: scale(0.96);
}

.btn-ghost {
  background: #fff;
  color: var(--accent-deep);
  border: 2px solid var(--accent-soft);
}

.themes {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.theme-pill {
  border: 2px solid var(--accent-soft);
  background: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
}

.theme-pill.is-active {
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-color: var(--accent);
}

.code-block {
  position: relative;
  background: #2a2224;
  color: #ffe8ef;
  border-radius: 16px;
  padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.hint {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.footer-note {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 28px;
}
