.muji-read-nourish {
  position: relative;
}
#receive-plant-point {
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  width: 100%;
}

#receive-plant-point > div,
#my-current-plant > div {
  width: 100%;
}

#receive-plant-point.is-inview {
  opacity: 1;
}

.muji-read-nourish:has(#receive-plant-point.is-inview) #my-current-plant {
  opacity: 0.5;
  filter: blur(6px);
}
#receive-plant-point.is-inview #apply-plant-point {
  pointer-events: auto;
}

#receive-plant-point .wp-block-heading {
  transition: opacity 1s ease;
}

#receive-plant-point.is-fading {
  opacity: 0;
  pointer-events: none !important;
}

#receive-plant-point.is-applying #apply-plant-point,
#receive-plant-point.is-applying .wp-block-heading,
#receive-plant-point.is-applying p {
  opacity: 0;
  pointer-events: none !important;
}

#receive-plant-point .muji-plant-point-video {
  opacity: 0.9;
  transform: rotate(12deg);
  mix-blend-mode: darken;
  -webkit-mask-image: radial-gradient(
    ellipse 62% 78% at 50% 50%,
    #000 42%,
    transparent 72%
  );
  mask-image: radial-gradient(
    ellipse 62% 78% at 50% 50%,
    #000 42%,
    transparent 72%
  );
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

#my-current-plant {
  transition: all 0.6s ease;
}

#my-current-plant #progress-bar {
  --muji-plant-bar-duration: 1000ms;
}
#my-current-plant #progress-bar > .wp-block-group {
  width: var(--muji-plant-fill, 0%) !important;
  transition: width var(--muji-plant-bar-duration, 1000ms) ease;
}
#my-current-plant #muji-current-plant-figure {
  --muji-plant-frame: 280px;
  /* scale/lift：PHP／JS 寫入 inline --muji-plant-*（勿用 attr(type(<number>))，Safari／iOS 不支援） */
  box-sizing: border-box;
  min-height: var(--muji-plant-frame);
  height: var(--muji-plant-frame);
  /* scale < 51 → lift 1，上移半個框高 */
  margin-top: calc(
    var(--muji-plant-frame) / -2 * var(--muji-plant-lift, 0)
  ) !important;

  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: calc(
    var(--muji-plant-frame) * (100 - var(--muji-plant-scale, 100)) / 100
  );
}
#my-current-plant #muji-current-plant-figure img {
  height: 100%;
  width: auto;
}
/* My Page #my-plant-figure：同一個框高＋data-scale。改 --muji-plant-frame 調高度。 */
#my-plant-figure {
  --muji-plant-frame: 350px;
  box-sizing: border-box;
  min-height: var(--muji-plant-frame);
  height: var(--muji-plant-frame);
  margin-top: calc(
    var(--muji-plant-frame) / -2 * var(--muji-plant-lift, 0)
  ) !important;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: calc(
    var(--muji-plant-frame) * (100 - var(--muji-plant-scale, 100)) / 100
  );
}
#my-plant-figure img {
  height: 100%;
  width: auto;
}
/* /history/ 頭圖。縮圖大小改 --muji-plant-thumb。 */
.muji-plant-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--wp--preset--spacing--40, 1.5rem);
  min-height: 280px;
  margin-bottom: 0 !important;
  padding: 0;
  overflow: hidden;
}
.muji-plant-header__thumb {
  position: absolute;
  top: 0;
  right: 0;
  width: 70%;
  max-height: 130%;
  object-fit: contain;
  object-position: right top;
  z-index: 1;
}
.muji-plant-header__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  width: calc(100% - 48px);
  max-width: 1440px;
  position: relative;
  z-index: 2;
}
.muji-plant-header__name,
.muji-plant-header__hint {
  margin: 0;
}

.muji-plant-header__hint {
  padding-left: 3rem;
  position: relative;
}
.muji-plant-header__hint::before {
  content: "";
  width: 2.5em;
  height: 0;
  border-top: 1px solid #dbc5c5;
  position: absolute;
  left: 0;
  top: 14px;
}
/* 已完成的樹卡片。改 --muji-completed-plant-h 調統一高度。 */
.muji-reading-path .muji-link-wrap {
  padding: 24px;
  border-radius: 16px;
  gap: 20px;
  border: 1px solid #e0e0e0;
  transition: background 0.6s ease;
}
@media screen and (max-width: 600px) {
  .muji-reading-path .muji-link-wrap {
    padding: 12px;
  }
}
.muji-reading-path .muji-link-wrap:hover {
  background: #ffffff;
}
.muji-reading-path .muji-link-wrap > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
}
.muji-reading-path .muji-link-wrap .muji-completed-plant__figure {
  --muji-completed-plant-h: 250px;
  display: block;
  width: 100%;
  aspect-ratio: 1/1;
  height: 100%;
  margin: 0;
}
.muji-reading-path .muji-link-wrap .muji-completed-plant__figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

.muji-reading-path .muji-link-wrap .wp-block-heading {
  padding-bottom: 1em;
  border-bottom: 1px solid #e0e0e0;
}
.muji-reading-path .muji-link-wrap .muji-completed-plant__reads {
  margin: 0;
  font-size: 13px !important;
  line-height: 1.4;
  color: #8a8178;
  text-align: center;
}
#my-current-plant #muji-current-plant-figure.is-sway,
#my-plant-figure.is-sway {
  position: relative;
  overflow: visible;
}
#my-current-plant #muji-current-plant-figure.is-sway img,
#my-plant-figure.is-sway img {
  visibility: hidden;
}
#my-current-plant #muji-current-plant-figure .muji-plant-sway,
#my-plant-figure .muji-plant-sway {
  position: absolute;
  display: block;
  pointer-events: auto;
}

/* 植物、空狀態標題、提示、階段名。改 .is-fadein 這段就能調出現方式。 */

#my-current-plant #title-no-plant,
#my-current-plant #title-hint-text,
#my-current-plant #plant-phase-tag,
#my-current-plant #muji-current-plant-figure {
  opacity: 0;
  transition: all 0.6s ease;
}

#my-current-plant #progress-bar {
  opacity: 0;
}

#my-current-plant #title-no-plant,
#my-current-plant #title-hint-text {
  transition: all 1s ease;
  transform: translateY(10px);
}

#my-current-plant #progress-bar.is-fadein,
#my-current-plant #title-no-plant.is-fadein,
#my-current-plant #title-hint-text.is-fadein,
#my-current-plant #plant-phase-tag.is-fadein,
#my-current-plant #muji-current-plant-figure.is-fadein {
  transform: translateY(0);
  opacity: 1;
}

/* No growing plant: keep the empty title and the figure's frame. Hide stage copy. */
body:not(.muji-has-plant) #my-current-plant #title-hint-text,
body:not(.muji-has-plant) #my-current-plant #plant-phase-tag,
body:not(.muji-has-plant) #my-current-plant #progress-bar {
  display: none !important;
}

body:not(.muji-has-plant) #my-current-plant #muji-current-plant-figure {
  margin-top: 0 !important;
}

body.muji-has-plant #my-current-plant #title-no-plant {
  display: none !important;
}

body.muji-plant-mature #my-current-plant #progress-bar {
  display: none !important;
}

/* 非閱讀升級：同一塊 muji-read-nourish，白底面板。狀態掛在面板上，列表頁沒有 body class 也看得到。 */
body.muji-levelup-open {
  overflow: hidden;
}

.muji-levelup {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
}

.muji-levelup__overlay {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 45%);
}

.muji-levelup__panel {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  background: #fff;
  width: min(460px, calc(100% - 24px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  border-radius: 24px;
}

/* 頁內這層是蓋在植物上。popup 改回正常往下排，白底裡才看得到按鈕和植物。 */
.muji-levelup__panel #receive-plant-point {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  pointer-events: auto;
  display: grid;
  place-items: center;
  backdrop-filter: blur(12px);
}

.muji-levelup__panel #receive-plant-point.is-fading {
  opacity: 0;
  pointer-events: none;
}

.muji-levelup__panel
  .muji-read-nourish:has(#receive-plant-point.is-inview)
  #my-current-plant {
  opacity: 1;
  filter: none;
}

.muji-levelup__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #3a3a3a;
  font-size: 24px;
  line-height: 32px;
  cursor: pointer;
}

.muji-levelup__panel.muji-has-plant #my-current-plant #title-hint-text,
.muji-levelup__panel.muji-has-plant #my-current-plant #plant-phase-tag,
.muji-levelup__panel.muji-has-plant #my-current-plant #progress-bar {
  display: flex !important;
}

.muji-levelup__panel.muji-has-plant #my-current-plant #title-no-plant {
  display: block !important;
}

.muji-levelup__panel.muji-has-plant
  #my-current-plant
  #muji-current-plant-figure {
  margin-top: calc(
    var(--muji-plant-frame) / -2 * var(--muji-plant-lift, 0)
  ) !important;
}

.muji-levelup__panel.muji-plant-mature #my-current-plant #progress-bar {
  display: none !important;
}