/* 人生养成 · 第一版 */

:root {
  --game-ink: #1a1410;
  --game-warm: #f3e6d4;
  --game-rose: #c45c4a;
  --game-gold: #d4a574;
  --game-cloud: #dce9f5;
  --game-panel: rgba(255, 248, 240, 0.92);
  --game-shadow: 0 12px 40px rgba(26, 20, 16, 0.28);
  --font-story: "ZCOOL XiaoWei", "Noto Serif SC", "Songti SC", serif;
  --font-ui: "Noto Sans SC", system-ui, sans-serif;
}

.page-shell {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - var(--header-h) - var(--site-footer-h) - env(safe-area-inset-bottom, 0px));
  margin-top: var(--header-h);
  padding: 12px max(16px, 4vw) 16px;
  display: flex;
  justify-content: center;
  align-items: stretch;
  box-sizing: border-box;
  overflow: hidden;
}

#game-root {
  position: relative;
  width: min(1080px, 100%);
  margin-inline: auto;
  min-height: calc(100vh - var(--header-h) - var(--site-footer-h) - env(safe-area-inset-bottom, 0px) - 28px);
  height: calc(100vh - var(--header-h) - var(--site-footer-h) - env(safe-area-inset-bottom, 0px) - 28px);
  background: #07090f;
  color: var(--game-ink);
  font-family: var(--font-ui);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---- 加载：暗幕 + 云 ---- */
.boot-layer {
  position: absolute;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  background: #05060a;
}

.boot-layer.is-done {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s ease 0.2s;
}

.boot-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 70%, #9ec5e8 0%, transparent 60%),
    linear-gradient(180deg, #1a2a44 0%, #6f93b8 42%, #c9dff2 78%, #eef5fb 100%);
  opacity: 0;
  transition: opacity 1.1s ease;
}

.boot-layer.is-open .boot-sky {
  opacity: 1;
}

.boot-cloud {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  filter: blur(2px);
  box-shadow:
    28px 8px 0 -4px rgba(255, 255, 255, 0.7),
    -24px 10px 0 -6px rgba(255, 255, 255, 0.65),
    8px -14px 0 -2px rgba(255, 255, 255, 0.55);
  animation: cloud-drift 18s linear infinite;
  opacity: 0.9;
}

@keyframes cloud-drift {
  from { transform: translateX(0); }
  to { transform: translateX(12vw); }
}

.curtain {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 52%;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.25), transparent 18%),
    repeating-linear-gradient(
      90deg,
      #14151c 0 14px,
      #0c0d12 14px 28px
    );
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.55);
  transition: transform 2.4s cubic-bezier(0.65, 0, 0.35, 1);
  z-index: 2;
}

.curtain-left {
  left: 0;
  transform-origin: left center;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.curtain-right {
  right: 0;
  transform-origin: right center;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(270deg, rgba(0, 0, 0, 0.25), transparent 18%),
    repeating-linear-gradient(
      90deg,
      #14151c 0 14px,
      #0c0d12 14px 28px
    );
}

.boot-layer.is-open .curtain-left {
  transform: translateX(-102%);
}

.boot-layer.is-open .curtain-right {
  transform: translateX(102%);
}

.boot-center {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  text-align: center;
  color: #e8edf5;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.boot-layer.is-open .boot-center {
  opacity: 0.95;
}

.boot-layer.is-done .boot-center {
  opacity: 0;
}

.boot-title {
  font-family: var(--font-story);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: 0.18em;
  margin-bottom: 0.6rem;
}

.boot-sub {
  font-size: 0.92rem;
  color: rgba(232, 237, 245, 0.72);
  margin-bottom: 1.4rem;
}

.boot-bar {
  width: min(280px, 60vw);
  height: 3px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  overflow: hidden;
}

.boot-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7eb8e8, #f3e6d4);
  transition: width 0.35s ease;
}

/* ---- 游戏舞台 ---- */
.stage {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.stage.is-active {
  opacity: 1;
  pointer-events: auto;
}

.home-stage {
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #1c1510;
}

.home-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(28, 21, 16, 0.92);
  color: var(--game-warm);
  border-bottom: 1px solid rgba(212, 165, 116, 0.25);
  z-index: 5;
}

.home-top h1 {
  font-family: var(--font-story);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.home-meta {
  font-size: 0.82rem;
  opacity: 0.85;
}

.room-wrap {
  position: relative;
  overflow: hidden;
  background: #1a1410;
}

.room-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
  user-select: none;
  -webkit-user-drag: none;
}

.hotspot {
  position: absolute;
  width: 6.2%;
  aspect-ratio: 1;
  min-width: 34px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.08) 42%, transparent 68%);
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.55), 0 0 18px rgba(255, 230, 180, 0.25);
  animation: pulse-spot 2.6s ease-in-out infinite;
  transform: translate(-50%, -50%);
}

.hotspot::after {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
}

.hotspot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  transform: scale(1.35);
  opacity: 0.7;
}

.hotspot.is-found {
  animation: none;
  opacity: 0.22;
  pointer-events: none;
  filter: grayscale(0.35);
}

@keyframes pulse-spot {
  0%, 100% { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.5), 0 0 10px rgba(255, 230, 180, 0.15); }
  50% { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85), 0 0 22px rgba(255, 230, 180, 0.4); }
}

.home-dock {
  display: grid;
  gap: 10px;
  padding: 12px 16px 14px;
  background: rgba(18, 14, 11, 0.94);
  color: var(--game-warm);
  border-top: 1px solid rgba(212, 165, 116, 0.22);
}

.found-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}

.found-chip {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(243, 230, 212, 0.12);
  border: 1px solid rgba(212, 165, 116, 0.35);
}

.dock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.65rem 1.15rem;
  border-radius: 10px;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn:not(:disabled):hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #c45c4a, #a84538);
  color: #fff8f2;
  box-shadow: 0 8px 20px rgba(196, 92, 74, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--game-warm);
  border: 1px solid rgba(243, 230, 212, 0.35);
}

.hint-line {
  font-size: 0.82rem;
  opacity: 0.8;
  line-height: 1.45;
}

/* ---- 模态 / 面板 ---- */
.modal-layer {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 6, 5, 0.55);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.modal-layer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.panel {
  width: min(440px, 100%);
  background: var(--game-panel);
  border-radius: 18px;
  padding: 22px 22px 18px;
  box-shadow: var(--game-shadow);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.panel h2 {
  font-family: var(--font-story);
  font-size: 1.35rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.panel p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: #4a3d34;
  margin-bottom: 1rem;
}

.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.role-btn {
  padding: 14px 10px;
  border-radius: 12px;
  border: 1px solid rgba(26, 20, 16, 0.12);
  background: #fffaf4;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--game-ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.role-btn:hover,
.role-btn.is-on {
  border-color: var(--game-rose);
  box-shadow: 0 0 0 2px rgba(196, 92, 74, 0.2);
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.86rem;
  color: #5a4a40;
}

.field input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(26, 20, 16, 0.16);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  background: #fffaf4;
  color: var(--game-ink);
}

.field input:focus {
  outline: 2px solid rgba(196, 92, 74, 0.35);
  border-color: var(--game-rose);
}

.seal-tip {
  margin-bottom: 0.85rem !important;
}

.seal-warn {
  font-size: 0.78rem !important;
  color: #8a6a4a !important;
  line-height: 1.5 !important;
  margin-bottom: 14px !important;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(212, 165, 116, 0.15);
  border: 1px solid rgba(212, 165, 116, 0.35);
}

.verify-panel {
  text-align: center;
}

.verify-panel h2 {
  margin-bottom: 0.75rem;
}

.verify-status {
  font-size: 0.95rem;
  color: #4a3d34;
  margin-bottom: 1rem;
  min-height: 1.4em;
}

.verify-bar {
  width: 100%;
  height: 8px;
  border-radius: 99px;
  background: rgba(26, 20, 16, 0.1);
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.verify-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #c45c4a, #d4a574);
  transition: width 0.1s linear;
}

.verify-panel.is-pass .verify-status {
  color: #2f6b45;
  font-weight: 600;
}

.verify-panel.is-fail .verify-status {
  color: #a84538;
  font-weight: 600;
}

.gender-announce {
  font-family: var(--font-story);
  font-size: 1.05rem !important;
  color: #3d2f28 !important;
}

.panel .btn-primary {
  width: 100%;
}

/* ---- 领养动画 ---- */
.adopt-layer {
  position: absolute;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(18, 12, 10, 0.55), rgba(12, 10, 9, 0.78)),
    url("../assets/nursery-room.png?v=1") center / cover no-repeat;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.adopt-layer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cradle {
  text-align: center;
  color: #fff8f0;
  transform: translateY(18px) scale(0.92);
  opacity: 0;
  transition: transform 1s cubic-bezier(0.2, 0.9, 0.2, 1), opacity 0.8s ease;
  max-width: min(420px, 100%);
}

.adopt-layer.is-open .cradle {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.cradle-figure {
  position: relative;
  width: min(280px, 70vw);
  margin: 0 auto 14px;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.35));
  animation: cradle-breathe 2.6s ease-in-out infinite;
}

.cradle-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
}

.cradle-glow {
  position: absolute;
  inset: -8% -6% auto;
  height: 70%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 230, 190, 0.45) 0%, transparent 68%);
  pointer-events: none;
  z-index: -1;
}

@keyframes cradle-breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.cradle h2 {
  font-family: var(--font-story);
  font-size: 1.6rem;
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}

.cradle p {
  max-width: 360px;
  margin: 0 auto 1.2rem;
  line-height: 1.65;
  color: rgba(255, 248, 240, 0.92);
  font-size: 0.95rem;
  white-space: pre-line;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
  background: rgba(12, 10, 9, 0.42);
  border-radius: 14px;
  padding: 12px 14px;
  backdrop-filter: blur(6px);
}

/* ---- 成长剧场 ---- */
.life-stage {
  display: grid;
  grid-template-rows: auto 1fr;
  color: var(--game-warm);
  background: #1a1410;
}

.scene-caption {
  position: absolute;
  top: 56px;
  left: 16px;
  z-index: 4;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(12, 10, 9, 0.55);
  border: 1px solid rgba(243, 230, 212, 0.18);
  backdrop-filter: blur(8px);
}

.daily-view {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  z-index: 1;
}

.daily-spots {
  position: relative;
  min-height: 280px;
}

.explore-spot {
  position: absolute;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, rgba(255, 220, 160, 0.12) 48%, transparent 72%);
}

.explore-spot.is-soft {
  animation: soft-glow 3.2s ease-in-out infinite;
  opacity: 0.55;
}

.explore-spot.is-mystery {
  width: 48px;
  height: 48px;
  background: radial-gradient(circle, rgba(255, 190, 120, 0.7) 0%, rgba(196, 92, 74, 0.25) 42%, transparent 70%);
  box-shadow: 0 0 0 0 rgba(255, 180, 120, 0.45);
  animation: mystery-pulse 2.1s ease-in-out infinite;
}

@keyframes soft-glow {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.7; }
}

@keyframes mystery-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 180, 120, 0.5); transform: translate(-50%, -50%) scale(1); }
  50% { box-shadow: 0 0 0 14px rgba(255, 180, 120, 0); transform: translate(-50%, -50%) scale(1.06); }
}

.daily-dock {
  z-index: 2;
  padding: 12px 16px 14px;
  background: rgba(12, 10, 9, 0.72);
  border-top: 1px solid rgba(243, 230, 212, 0.12);
  backdrop-filter: blur(10px);
}

.daily-hint {
  font-size: 0.88rem;
  line-height: 1.55;
  opacity: 0.9;
  margin-bottom: 10px;
}

.event-view {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(12, 10, 9, 0.55) 28%, rgba(12, 10, 9, 0.82) 100%);
}

.life-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(18, 12, 10, 0.28) 0%, rgba(18, 12, 10, 0.72) 58%, rgba(12, 10, 9, 0.92) 100%),
    url("../assets/nursery-room.png?v=1") center / cover no-repeat;
  background-color: #1a1410;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.life-bg.is-fading {
  opacity: 0.35;
}

.life-stage > *:not(.life-bg) {
  position: relative;
  z-index: 1;
}

.life-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(243, 230, 212, 0.12);
  font-size: 0.84rem;
  background: rgba(12, 10, 9, 0.45);
  backdrop-filter: blur(8px);
}

.life-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 16px;
  align-items: end;
  padding: 18px 16px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  min-height: 0;
}

.life-scene-card {
  display: grid;
  place-items: end center;
  min-height: 220px;
}

.life-scene-card img {
  width: min(280px, 100%);
  height: auto;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  background: rgba(255, 248, 240, 0.08);
}

.life-story {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.narrative {
  background: rgba(18, 12, 10, 0.62);
  border: 1px solid rgba(243, 230, 212, 0.16);
  border-radius: 16px;
  padding: 18px 18px 14px;
  backdrop-filter: blur(10px);
}

.narrative .scene-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  opacity: 0.65;
  margin-bottom: 8px;
}

.narrative .voice-text {
  font-family: var(--font-story);
  font-size: 1.08rem;
  line-height: 1.75;
  margin-bottom: 12px;
}

.narrative .child-line {
  font-size: 0.92rem;
  opacity: 0.88;
  padding: 10px 12px;
  border-left: 3px solid rgba(212, 165, 116, 0.7);
  background: rgba(0, 0, 0, 0.18);
  border-radius: 0 10px 10px 0;
}

.choice-prompt {
  font-family: var(--font-story);
  font-size: 1rem;
  letter-spacing: 0.18em;
  color: rgba(243, 230, 212, 0.9);
  text-align: center;
  padding: 4px 0 2px;
}

.choice-list {
  display: grid;
  gap: 10px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.choice-list.is-ready {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.choice-btn {
  text-align: left;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(243, 230, 212, 0.22);
  background: rgba(18, 12, 10, 0.55);
  color: var(--game-warm);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  backdrop-filter: blur(8px);
  animation: choice-in 0.35s ease both;
}

@keyframes choice-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.choice-btn:hover {
  background: rgba(196, 92, 74, 0.22);
  border-color: rgba(196, 92, 74, 0.55);
}

.insight-card {
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.18), rgba(196, 92, 74, 0.12));
  border: 1px solid rgba(212, 165, 116, 0.35);
}

.insight-card strong {
  display: block;
  font-family: var(--font-story);
  margin-bottom: 4px;
}

.life-foot {
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(243, 230, 212, 0.1);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  opacity: 0.85;
  background: rgba(12, 10, 9, 0.55);
  backdrop-filter: blur(8px);
}

.voice-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: inherit;
  background: transparent;
  border: 1px solid rgba(243, 230, 212, 0.25);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%) translateY(12px);
  z-index: 50;
  max-width: min(420px, 90vw);
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 248, 240, 0.95);
  color: var(--game-ink);
  box-shadow: var(--game-shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  font-size: 0.9rem;
  line-height: 1.5;
}

.toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 860px) {
  .life-main {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .life-scene-card {
    place-items: center;
    min-height: 0;
  }

  .life-scene-card img {
    width: min(200px, 55vw);
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 8px 10px 12px;
  }

  #game-root {
    border-radius: 12px;
  }

  .hotspot {
    width: 11%;
  }
  .role-grid {
    grid-template-columns: 1fr;
  }
}
