@font-face {
  font-family: RainSoloSerif;
  src: url(fonts/rainsolo-serif.woff2) format('woff2');
  font-weight: 300 500;
  font-style: normal;
  font-display: swap;
}
.home-ready {
  --action-rail-right: max(26px, env(safe-area-inset-right, 0px));
  --action-rail-width: 46px;
  color: #e5e3d8;
  background-color: #111f2c;
  font-family: Inter, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
.home-ready .dock,
.home-ready .scene-label {
  display: none;
}
.home-ready .shade {
  background: linear-gradient(180deg, #06101c40, transparent 45%, #06101955);
}
.home-veil {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, #07111f3b, #09121c22 45%, #06101d6e);
  transition: background 1s;
}
.home-header {
  position: fixed;
  z-index: 25;
  left: 4.3vw;
  right: 4.3vw;
  top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.home-brand {
  font-family: RainSoloSerif, Georgia, serif;
  font-size: 30px;
  letter-spacing: 2px;
  color: #e7e2d2;
  font-weight: 400;
}
.home-languages {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: RainSoloSerif, Georgia, serif;
  font-size: 11px;
  letter-spacing: 2px;
  color: #a9bbb8;
  pointer-events: auto;
}
.home-languages button {
  padding: 7px 2px;
  font: inherit;
  color: #a1b3b5;
  background: none;
  border-radius: 0;
}
.home-languages button[aria-pressed='true'] {
  color: #e7e1d2;
}
.home-languages button:hover {
  color: #fff;
  background: none;
}
.home-intro {
  position: fixed;
  z-index: 3;
  left: 4vw;
  right: 4vw;
  top: 23svh;
  text-align: center;
  pointer-events: none;
  transition:
    opacity 1.1s,
    transform 1.1s;
  text-shadow: 0 2px 24px #06101b55;
}
.home-eyebrow {
  font-family: Georgia, serif;
  font-size: 10px;
  letter-spacing: 9px;
  color: #c3d0cb;
  margin: 0 0 28px;
  padding-left: 9px;
}
.home-intro h1 {
  font-family: RainSoloSerif, 'Songti SC', 'STSong', 'SimSun', serif;
  font-weight: 300;
  font-size: clamp(28px, 4.15vw, 78px);
  letter-spacing: clamp(2px, 0.45vw, 9px);
  line-height: 1.7;
  color: #e5e0d1;
  margin: 0;
}
.home-intro #home-description {
  font-family: RainSoloSerif, 'Songti SC', 'SimSun', serif;
  font-weight: 300;
  font-size: clamp(12px, 1.12vw, 20px);
  line-height: 2;
  letter-spacing: 4px;
  color: #cfd5ca;
  margin: 24px 0 0;
}
.home-player {
  position: fixed;
  z-index: 4;
  top: 55svh;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  display: flex;
  align-items: center;
  flex-direction: column;
  min-width: 260px;
}
.home-play {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border: 1px solid #d6dbce99;
  border-radius: 50%;
  color: #e1dfd2;
  background: #0717270a;
  backdrop-filter: blur(2px);
  transition:
    background 0.3s,
    border-color 0.3s,
    transform 0.3s;
}
.home-play:hover {
  background: #dce4d50c;
  border-color: #ebe9d9;
  transform: scale(1.035);
  color: #f1eedf;
}
.home-play:active {
  transform: scale(0.98);
}
.home-play svg {
  height: 30px;
  width: 30px;
  fill: currentColor;
  stroke: none;
}
.home-play:disabled {
  cursor: wait;
  opacity: 0.55;
}
#home-play-label {
  font-family: RainSoloSerif, 'Songti SC', 'SimSun', serif;
  font-size: 17px;
  letter-spacing: 4px;
  margin: 16px 0 6px;
  font-weight: 300;
}
#home-playing-scene {
  font-size: 9px;
  color: #b6c5bf;
  letter-spacing: 2px;
  line-height: 1.7;
}
.home-timer {
  position: fixed;
  top: 77svh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 25px;
  white-space: nowrap;
  font-family: RainSoloSerif, 'Songti SC', 'SimSun', serif;
  font-size: 12px;
  letter-spacing: 2px;
  color: #c8d0c3;
}
#home-timer-label {
  font-size: 11px;
  color: #b6c3bd;
  margin-right: 7px;
}
.home-timer button {
  position: relative;
  font: inherit;
  padding: 10px 0;
  color: #c8d0c3;
  background: none;
  border-radius: 0;
  letter-spacing: 2px;
  min-width: 38px;
}
.home-timer button:hover {
  color: #f0eddb;
  background: none;
}
.home-timer button[aria-pressed='true'] {
  color: #eee9d8;
}
.home-timer button[aria-pressed='true']:after {
  content: '';
  position: absolute;
  bottom: 2px;
  height: 1px;
  background: #d3d8c8;
  left: 0;
  right: 0;
}
#home-countdown {
  position: absolute;
  top: 49px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: Inter, sans-serif;
  font-size: 9px;
  letter-spacing: 1px;
  color: #9eb0ad;
  pointer-events: none;
}
.home-footer {
  position: fixed;
  left: 4.3vw;
  right: 4.3vw;
  bottom: 28px;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid #c7d2c33b;
  gap: 20px;
}
.home-footer button {
  padding: 4px 0;
  background: none;
  border-radius: 0;
  color: #d8dbcc;
  font-family: RainSoloSerif, 'Songti SC', 'SimSun', serif;
  letter-spacing: 2px;
  font-size: 11px;
}
.home-footer button:hover {
  color: #faf6e6;
  background: none;
}
.home-current {
  justify-self: start;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  text-align: left;
  line-height: 1.8;
}
.home-current #home-current-prefix {
  color: #b3c1b8;
}
/* Fixed-size navigation remains compact even with thousands of scenes. */
.home-scene-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.home-footer .home-scene-navigation button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}
.home-scene-navigation button:hover {
  background: #d8dfcf0c;
}
.home-scene-navigation svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#home-scene-position {
  min-width: 60px;
  text-align: center;
  font:
    10px/1 Inter,
    Arial,
    sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  color: #c4cebf;
  white-space: nowrap;
}
.home-footer-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 25px;
}
.home-footer .home-sound {
  padding: 3px;
}
.home-sound svg {
  height: 19px;
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.home-ready .scene-actions {
  top: 34px;
  right: calc(4.3vw + 125px);
  background: none;
  box-shadow: none;
  backdrop-filter: none;
  border: none;
  padding: 0;
  color: #b5c7bd;
  opacity: 0.68;
  gap: 1px;
}
.home-ready .scene-actions .like-count {
  font-size: 8px;
}
.home-ready .scene-actions .top-action {
  color: #c3d0c4;
  width: 29px;
  min-width: 29px;
  height: 29px;
}
.home-ready .scene-actions svg {
  width: 16px;
  height: 16px;
}
.home-ready .scene-actions .action-divider {
  height: 12px;
  margin: 0 3px;
}
.home-ready .action-toast {
  top: 84px;
  right: 4.3vw;
}
.home-ready .library-shell {
  left: 4.3vw;
  bottom: 92px;
  width: min(790px, calc(100vw - 8.6vw));
  max-height: calc(100svh - 165px);
  z-index: 30;
  background: linear-gradient(135deg, #1b3039f7, #10262ff7);
}
.home-ready .rain-toggle {
  position: static;
  display: inline-block;
  border: 1px solid #c2d0b82b;
  border-radius: 9px;
  margin: 14px 0 0;
  font-size: 10px;
  padding: 9px 13px;
  max-width: none;
  white-space: nowrap;
}
.home-ready .poem {
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s;
}
.home-ready.is-listening:not(.poem-finished) .poem {
  opacity: 0.9;
}
.is-listening .home-intro {
  opacity: 0;
  transform: translateY(-9px);
}
.home-header,
.home-footer,
.home-player,
.home-timer,
.home-ready .scene-actions {
  transition: opacity 0.8s;
}
.home-resting {
  cursor: none;
}
.home-resting .home-header,
.home-resting .home-footer,
.home-resting .home-player,
.home-resting .home-timer,
.home-resting .scene-actions {
  opacity: 0;
  pointer-events: none;
}
.home-resting .home-player *,
.home-resting .home-header *,
.home-resting .home-footer *,
.home-resting .home-timer *,
.home-resting .scene-actions * {
  pointer-events: none;
}
.home-message {
  position: fixed;
  bottom: 150px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  font-size: 11px;
  letter-spacing: 1px;
  text-align: center;
  line-height: 1.9;
  color: #e0c2ac;
  max-width: 80vw;
}
.home-message:empty {
  display: none;
}
html[lang='en'] .home-intro h1 {
  font-family: RainSoloSerif, Georgia, serif;
  font-size: clamp(32px, 4.4vw, 82px);
  letter-spacing: 1px;
  line-height: 1.45;
}
html[lang='en'] .home-intro #home-description {
  letter-spacing: 1px;
}
html[lang='en'] .home-timer,
html[lang='en'] .home-footer button {
  font-family: Georgia, serif;
  letter-spacing: 0.6px;
}
@media (max-width: 700px) {
  .home-header {
    left: 24px;
    right: 24px;
    top: 24px;
  }
  .home-brand {
    font-size: 24px;
    letter-spacing: 1px;
  }
  .home-languages {
    font-size: 9px;
    gap: 6px;
    letter-spacing: 1px;
  }
  .home-ready .scene-actions {
    top: 26px;
    right: 108px;
  }
  .home-ready .scene-actions .top-action {
    min-width: 25px;
    width: 25px;
    height: 25px;
  }
  .home-ready .scene-actions .like-action {
    padding: 0 4px;
    gap: 4px;
  }
  .home-eyebrow {
    font-size: 8px;
    letter-spacing: 5px;
    margin-bottom: 25px;
    padding-left: 5px;
  }
  .home-intro {
    top: 24svh;
    left: 18px;
    right: 18px;
  }
  .home-intro h1 {
    font-size: clamp(25px, 6.4vw, 42px);
    letter-spacing: 2px;
    line-height: 1.7;
  }
  .home-intro #home-description {
    font-size: 12px;
    letter-spacing: 2px;
    line-height: 2;
    margin-top: 20px;
  }
  .home-player {
    top: 53svh;
    min-width: 240px;
  }
  .home-play {
    width: 72px;
    height: 72px;
  }
  .home-play svg {
    width: 27px;
    height: 27px;
  }
  #home-play-label {
    font-size: 15px;
    letter-spacing: 3px;
    margin-top: 14px;
  }
  #home-playing-scene {
    font-size: 8px;
  }
  .home-timer {
    top: 75svh;
    gap: 19px;
    font-size: 11px;
    letter-spacing: 1px;
  }
  #home-timer-label {
    font-size: 10px;
    margin-right: 0;
  }
  .home-timer button {
    letter-spacing: 1px;
  }
  .home-footer {
    left: 22px;
    right: 22px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    grid-template-columns: 1fr auto;
    row-gap: 12px;
    padding-top: 15px;
    column-gap: 8px;
  }
  .home-scene-navigation {
    grid-row: 2;
    grid-column: 1/-1;
    gap: 12px;
  }
  .home-footer button {
    font-size: 10px;
    letter-spacing: 1px;
  }
  .home-footer-actions {
    gap: 16px;
  }
  .home-current {
    gap: 3px;
  }
  .home-current #home-current-prefix {
    display: none;
  }
  .home-current span[aria-hidden] {
    display: none;
  }
  .home-ready .library-shell {
    left: 16px;
    bottom: 106px;
    width: calc(100vw - 32px);
    max-height: calc(100svh - 175px);
  }
  html[lang='en'] .home-intro h1 {
    font-size: clamp(29px, 7.2vw, 48px);
  }
  html[lang='en'] .home-timer {
    gap: 16px;
  }
  html[lang='en'] #home-play-label {
    font-size: 14px;
    letter-spacing: 1px;
  }
  .home-message {
    bottom: 145px;
    max-width: 90vw;
    width: 90vw;
  }
  .home-ready .poem {
    right: 25px;
    top: 15vh;
  }
}
@media (max-height: 620px) and (min-width: 701px) {
  .home-intro {
    top: 19vh;
  }
  .home-eyebrow {
    margin-bottom: 16px;
  }
  .home-intro h1 {
    font-size: 48px;
  }
  .home-intro #home-description {
    margin-top: 10px;
  }
  .home-player {
    top: 52vh;
  }
  .home-play {
    width: 64px;
    height: 64px;
  }
  #home-play-label {
    font-size: 14px;
    margin-top: 10px;
  }
  .home-timer {
    top: 77svh;
  }
  .home-footer {
    bottom: 15px;
    padding-top: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .home-intro,
  .home-header,
  .home-footer,
  .home-player,
  .home-timer,
  .home-play {
    transition: none !important;
  }
  .home-resting {
    cursor: auto;
  }
}

@media (max-height: 620px) {
  .home-intro {
    top: 18svh;
  }
  .home-intro h1 {
    font-size: 34px;
    line-height: 1.45;
  }
  .home-eyebrow {
    font-size: 8px;
    margin-bottom: 10px;
  }
  .home-intro #home-description {
    font-size: 12px;
    margin-top: 8px;
    line-height: 1.6;
  }
  .home-player {
    top: 51svh;
  }
  .home-play {
    height: 52px;
    width: 52px;
  }
  .home-play svg {
    width: 22px;
    height: 22px;
  }
  #home-play-label {
    font-size: 12px;
    margin-top: 8px;
  }
  #home-playing-scene {
    font-size: 8px;
  }
  .home-timer {
    top: 76svh;
  }
  .home-footer {
    bottom: 12px;
    padding-top: 9px;
  }
  .home-scene-navigation {
    display: none;
  }
  .home-footer {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 900px) {
  .home-ready .scene-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.home-footer #home-scenes {
  display: flex;
  align-items: center;
  gap: 7px;
}

/* One shared alignment row for the interaction count and language controls. */
.home-header {
  min-height: 36px;
}
.home-brand {
  line-height: 1.2;
}
.home-tools {
  display: flex;
  align-items: center;
  gap: 24px;
  pointer-events: auto;
  min-height: 32px;
}
.home-ready .home-tools .scene-actions {
  position: static;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  height: 32px;
  align-items: center;
  transform: none;
  margin: 0;
}
.home-ready .home-tools .scene-actions .top-action {
  height: 32px;
  min-height: 32px;
}
.home-ready .home-tools .scene-actions .like-action {
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-ready .home-tools .scene-actions .like-count {
  display: block;
  font-size: 11px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.home-tools .home-languages {
  height: 32px;
  line-height: 1;
}
.home-tools .home-languages button {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 2px;
  line-height: 1;
}
@media (max-width: 700px) {
  .home-header {
    min-height: 32px;
  }
  .home-tools {
    gap: 17px;
  }
  .home-ready .home-tools .scene-actions .like-count {
    font-size: 9px;
  }
  .home-tools .home-languages button {
    min-width: 21px;
  }
}

html[lang='en'] .home-intro h1,
html[lang='en'] .home-intro #home-description,
html[lang='en'] #home-play-label {
  font-family: Georgia, 'Times New Roman', serif;
}

/* Quiet vertical action rail: heart for likes, star for saved scenes. */
.home-ready .scene-actions {
  position: fixed;
  inset: auto var(--action-rail-right) auto auto;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  height: auto;
  width: var(--action-rail-width);
  min-width: var(--action-rail-width);
  opacity: 0.88;
  pointer-events: auto;
  z-index: 24;
}
.home-ready .scene-actions .top-action,
.home-ready .scene-actions .like-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 46px;
  min-width: 46px;
  min-height: 57px;
  height: auto;
  padding: 6px 2px;
  border-radius: 16px;
  background: none;
  color: #d9dfd7;
}
.home-ready .scene-actions svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  transition:
    fill 0.2s,
    color 0.2s,
    transform 0.2s;
}
.home-ready .scene-actions .like-count,
.home-ready .scene-actions .favorite-count,
.home-ready .scene-actions .share-count {
  display: block;
  min-width: 18px;
  font-family: Inter, Arial, sans-serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: inherit;
}
.home-ready .scene-actions .top-action:hover {
  color: #fff;
  background: #d5e1d707;
}
.home-ready .scene-actions .like-action[aria-pressed='true'] {
  color: #f4f2e9;
  background: none;
}
.home-ready .scene-actions .like-action[aria-pressed='true'] svg {
  fill: currentColor;
  stroke: currentColor;
}
.home-ready .scene-actions .save-action[aria-pressed='true'] {
  color: #f4f2e9;
  background: none;
}
.home-ready .scene-actions .save-action[aria-pressed='true'] svg {
  fill: currentColor;
  stroke: currentColor;
}
.home-ready .scene-actions .action-divider {
  display: none;
}
.home-resting .scene-actions {
  opacity: 0;
  pointer-events: none;
}
@media (max-width: 700px) {
  .home-ready {
    --action-rail-right: max(13px, env(safe-area-inset-right, 0px));
    --action-rail-width: 44px;
  }
  .home-ready .scene-actions {
    right: var(--action-rail-right);
    gap: 18px;
    min-width: var(--action-rail-width);
  }
  .home-ready .scene-actions .top-action,
  .home-ready .scene-actions .like-action {
    width: var(--action-rail-width);
    min-width: var(--action-rail-width);
    min-height: 52px;
  }
  .home-ready .scene-actions svg {
    width: 25px;
    height: 25px;
  }
  .home-ready .scene-actions .like-count,
  .home-ready .scene-actions .favorite-count,
  .home-ready .scene-actions .share-count {
    font-size: 10px;
  }
  .home-ready .poem {
    right: 73px;
    max-width: calc(100vw - 110px);
  }
}

.home-ready.poem-reset #poem-content p {
  animation-name: none !important;
}

/* Shared palette and typography for utility panels. */
.home-ready {
  --panel-font: Inter, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --panel-surface: linear-gradient(135deg, #1b3039f7, #10262ff7);
  --panel-text: #edf4f2;
  --panel-heading: #e5eee6;
  --panel-muted: #8ea9a0;
  --panel-border: #d2e5da32;
  --panel-shadow: 0 28px 90px #03192380;
}
.home-ready .library-shell {
  background: var(--panel-surface);
  color: var(--panel-text);
  font-family: var(--panel-font);
  border-color: var(--panel-border);
  box-shadow: var(--panel-shadow);
}

/* A single main transport controls the remembered mix. */
.home-ready #sound-view .controls[hidden],
.home-ready #rain-toggle[hidden] {
  display: none !important;
}
.home-ready #rain-sound-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  color: inherit;
  cursor: default;
  font: inherit;
  padding: 0;
  background: none;
  border: 0;
}
.home-ready #rain-sound-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
}

/* A softly swept arrow echoes the quiet, open shapes of the action rail. */
.home-ready .scene-actions .share-action svg {
  fill: none;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform-origin: center;
}
.home-ready .scene-actions .share-action[data-shared='true'] {
  color: #f4f2e9;
}
.home-ready .scene-actions .share-action[data-shared='true'] svg {
  fill: currentColor;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .home-ready .scene-actions .share-action:hover svg {
    transform: translate(1px, -1px);
  }
}
#share-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 30px;
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  background: var(--panel-surface);
  color: var(--panel-text);
  box-shadow: var(--panel-shadow);
  font-family: var(--panel-font);
}
#share-dialog::backdrop {
  background: #06131b70;
  backdrop-filter: blur(5px);
}
#share-close {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 44px;
  height: 44px;
  font-size: 22px;
  color: #afc4b9;
}
.share-eyebrow {
  margin: 0 0 18px;
  color: #9fb8ac;
  font-size: 9px;
  letter-spacing: 2px;
}
#share-title {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 400;
}
#share-help,
#share-feedback {
  color: #b9cabe;
  font-size: 12px;
  line-height: 1.8;
}
#share-link-label {
  display: block;
  font-size: 11px;
  margin: 20px 0 10px;
  color: #b9cabe;
}
#share-link {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid #a7c3af40;
  border-radius: 9px;
  background: #10282e;
  color: #e2e9d9;
  font: inherit;
  font-size: 16px;
}
#share-copy {
  width: 100%;
  min-height: 44px;
  margin-top: 14px;
  border-radius: 10px;
  background: #dcdcc0;
  color: #213a3b;
  font-size: 12px;
}
#share-feedback {
  min-height: 22px;
  margin-bottom: 0;
}

.home-ready .home-scene-navigation[hidden] {
  /* Preserve the center grid cell and footer height when guest controls are hidden. */
  display: flex !important;
  visibility: hidden;
  pointer-events: none;
}
@media (max-height: 620px) {
  .home-ready .home-scene-navigation[hidden] {
    display: none !important;
  }
}
