﻿/* Nav active */
.nav a.active {
  color: var(--emerald-700);
}

.msg-date-edit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin-top: 1.15rem;
  padding-top: 0.9rem;
  border-top: 1px dashed rgba(196, 92, 50, 0.22);
}

.msg-date-edit label {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.msg-date-edit input[type="date"] {
  width: auto;
  min-width: 10.5rem;
  padding: 0.4rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(196, 92, 50, 0.22);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
}

.msg-date-hint {
  font-size: 0.8rem;
  color: var(--emerald-700);
}

.msg-date-hint.error {
  color: #c45c5c;
}

/* Video gallery on photos page */
.video-divider {
  margin: 2.2rem auto 1.6rem;
  max-width: 420px;
}

.video-panel h3 {
  margin-bottom: 0.35rem;
}

.video-lead {
  margin: 0 0 1.2rem;
  color: var(--ink-muted);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

.video-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(180px, 0.9fr);
  gap: 1.1rem;
  margin-bottom: 1.35rem;
}

.video-stage {
  min-width: 0;
}

.video-empty {
  display: grid;
  place-content: center;
  gap: 0.35rem;
  min-height: 260px;
  border-radius: 16px;
  border: 1px dashed rgba(196, 92, 50, 0.28);
  background:
    radial-gradient(circle at 50% 30%, rgba(240, 154, 92, 0.14), transparent 55%),
    rgba(255, 255, 255, 0.55);
  color: var(--ink-muted);
  text-align: center;
  letter-spacing: 0.06em;
}

.video-empty p {
  margin: 0;
}

.video-player {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #2a1612;
  border: 1px solid rgba(196, 92, 50, 0.22);
  box-shadow: 0 16px 36px rgba(120, 50, 30, 0.14);
}

.video-player video {
  display: block;
  width: 100%;
  max-height: min(52vh, 460px);
  background: #1a0e0c;
}

.video-controls {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 0.55rem 0.7rem;
  padding: 0.65rem 0.75rem 0.75rem;
  background: linear-gradient(180deg, rgba(42, 22, 18, 0.05), rgba(42, 22, 18, 0.92));
}

.vc-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(212, 185, 120, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #f7fdf9;
  font-size: 0.85rem;
  cursor: pointer;
  line-height: 1;
}

.vc-btn:hover {
  background: rgba(255, 192, 150, 0.25);
}

.vc-time {
  font-size: 0.78rem;
  color: rgba(247, 253, 249, 0.85);
  letter-spacing: 0.04em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.vc-seek,
.vc-volume {
  width: 100%;
  accent-color: var(--emerald-400);
  cursor: pointer;
}

.vc-vol {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 110px;
}

.vc-volume {
  width: 84px;
}

.video-now {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.9rem;
  margin-top: 0.75rem;
}

.video-now strong {
  font-family: var(--font-cn);
  letter-spacing: 0.08em;
  color: var(--emerald-900);
}

.video-now small {
  color: var(--ink-muted);
}

.video-list-wrap h4 {
  margin: 0 0 0.65rem;
  font-family: var(--font-cn);
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: var(--emerald-800);
}

.video-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
  max-height: min(52vh, 420px);
  overflow: auto;
}

.video-list-empty {
  padding: 0.9rem;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.88rem;
  border: 1px dashed rgba(196, 92, 50, 0.22);
  border-radius: 12px;
}

.video-list-item {
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(196, 92, 50, 0.16);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.video-list-item:hover {
  border-color: rgba(196, 92, 50, 0.35);
  transform: translateY(-1px);
}

.video-list-item.active {
  border-color: var(--emerald-500);
  background: linear-gradient(135deg, rgba(255, 220, 195, 0.85), rgba(255, 255, 255, 0.9));
  box-shadow: 0 8px 18px rgba(120, 50, 30, 0.1);
}

.vli-title {
  display: block;
  font-family: var(--font-cn);
  letter-spacing: 0.04em;
  font-size: 0.92rem;
}

.vli-date {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.video-upload {
  margin-top: 0.4rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(196, 92, 50, 0.12);
}

@media (max-width: 820px) {
  .video-layout {
    grid-template-columns: 1fr;
  }

  .video-controls {
    grid-template-columns: auto 1fr;
  }

  .vc-time {
    justify-self: end;
  }

  .vc-seek {
    grid-column: 1 / -1;
  }

  .vc-vol {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

.nav a.active::after {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* Guide — top-down 9-petal flower */
.bloom-section {
  padding-top: 0;
  padding-bottom: 2rem;
  max-width: 980px;
}

.guide-hero {
  padding-bottom: 0.2rem;
}

.bloom-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(72vh, 700px);
  padding: 0.25rem 0 1.25rem;
}

.bloom-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(620px, 92vw);
  height: min(620px, 92vw);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 190, 140, 0.45), transparent 68%);
  filter: blur(12px);
  pointer-events: none;
}

.bloom-flower {
  --petal-n: 9;
  position: relative;
  z-index: 2;
  width: min(700px, 96vw);
  aspect-ratio: 1;
  margin: 0 auto;
}

.bloom-petal {
  --i: 0;
  --angle: calc(var(--i) * (360deg / var(--petal-n)));
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48%;
  height: 56%;
  margin: 0;
  padding: 0;
  text-decoration: none;
  color: inherit;
  transform: translate(-50%, -100%) rotate(var(--angle));
  transform-origin: 50% 100%;
  z-index: 2;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), filter 0.35s ease, z-index 0s;
  filter: drop-shadow(0 8px 12px rgba(60, 30, 20, 0.16));
  cursor: pointer;
}

.bloom-petal:hover,
.bloom-petal:focus-visible {
  z-index: 6;
  transform: translate(-50%, -100%) rotate(var(--angle)) scale(1.08) translateY(-6px);
  outline: none;
  filter: drop-shadow(0 14px 18px rgba(60, 30, 20, 0.28));
}

.bloom-petal-art {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.bloom-petal-label {
  position: absolute;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -50%) rotate(calc(var(--angle) * -1));
  width: 5.2em;
  text-align: center;
  font-family: var(--font-art-cn);
  font-size: clamp(0.82rem, 2.4vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.25;
  color: var(--emerald-900, #4a2418);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85),
    0 0 8px rgba(255, 255, 255, 0.55);
  pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.bloom-petal:hover .bloom-petal-label,
.bloom-petal:focus-visible .bloom-petal-label {
  transform: translate(-50%, -50%) rotate(calc(var(--angle) * -1)) scale(1.06);
}

.bloom-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  z-index: 8;
  pointer-events: none;
  filter: drop-shadow(0 6px 10px rgba(80, 40, 10, 0.22));
}

.bloom-center-art {
  display: block;
  width: 100%;
  height: auto;
  animation: bloom-center-spin 28s linear infinite;
}

@keyframes bloom-center-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  .bloom-stage {
    min-height: auto;
    padding-bottom: 2rem;
  }

  .bloom-flower {
    width: min(460px, 98vw);
  }

  .bloom-petal {
    width: 50%;
    height: 58%;
  }

  .bloom-petal-label {
    font-size: 0.8rem;
    width: 4.8em;
    top: 36%;
  }

  .bloom-center {
    width: 22%;
  }
}

/* Login gate */
.login-body .love-timer-dock,
.login-body .topbar,
.login-body .footer {
  display: none !important;
}

.login-wrap {
  position: relative;
  z-index: 2;
  min-height: min(78vh, 720px);
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem 3rem;
}

.login-card {
  width: min(420px, 100%);
  padding: 2rem 1.6rem 1.8rem;
  border-radius: 28px;
  background: linear-gradient(165deg, rgba(255, 248, 240, 0.92), rgba(255, 230, 220, 0.88));
  border: 1px solid rgba(120, 60, 40, 0.12);
  box-shadow: 0 18px 40px rgba(80, 40, 20, 0.14);
  text-align: center;
}

.login-eyebrow {
  margin: 0;
  font-family: var(--font-art-cn, "ZCOOL KuaiLe", sans-serif);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.login-card h1 {
  margin: 0.55rem 0 0.45rem;
  font-family: var(--font-cn);
  font-size: clamp(1.6rem, 4vw, 2rem);
  color: var(--emerald-900, #4a2418);
}

.login-desc {
  margin: 0 0 1.2rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-muted);
}

.login-error {
  margin: 0 0 0.9rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: rgba(220, 80, 80, 0.12);
  color: #a03040;
  font-size: 0.9rem;
}

.login-form {
  display: grid;
  gap: 0.55rem;
  text-align: left;
}

.login-label {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.login-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(120, 60, 40, 0.18);
  background: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  color: var(--emerald-900, #4a2418);
}

.login-input:focus {
  outline: 2px solid rgba(224, 120, 80, 0.45);
  border-color: transparent;
}

.login-submit {
  margin-top: 0.45rem;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.2rem;
  font-size: 1rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  color: #fff8f2;
  background: linear-gradient(135deg, #e87850, #c85860);
  box-shadow: 0 10px 20px rgba(180, 70, 50, 0.25);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.login-submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

/* Subpage hero */
.page-hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2.4rem 5vw 0.5rem;
}

.back-home {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  transition: color 0.2s ease;
}

.back-home:hover {
  color: var(--emerald-700);
}

.page-hero h1 {
  margin: 0.35rem 0 0.5rem;
  font-family: var(--font-cn);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: 0.16em;
  background: linear-gradient(120deg, var(--emerald-900), var(--emerald-600));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-hero p {
  margin: 0;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
}

.page-body {
  padding-top: 1.5rem;
  max-width: 920px;
}

/* Flip book */
.book-shell {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.book {
  position: relative;
  min-height: min(62vh, 560px);
  border-radius: 4px 22px 22px 4px;
  background:
    linear-gradient(90deg, rgba(58, 22, 16, 0.55) 0 14px, transparent 14px),
    linear-gradient(145deg, #f4fff9 0%, #e7f8ef 45%, #dff3e8 100%);
  border: 1px solid rgba(212, 185, 120, 0.45);
  box-shadow:
    0 28px 60px rgba(58, 22, 16, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.35),
    10px 12px 0 rgba(92, 36, 24, 0.25);
  color: var(--ink);
  overflow: hidden;
  perspective: 1200px;
}

.book-text {
  min-height: min(48vh, 420px);
}

.book-spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 14px;
  background: linear-gradient(180deg, #7a3422, #c45c32 50%, #5c2418);
  box-shadow: 2px 0 10px rgba(58, 22, 16, 0.25);
  z-index: 2;
}

.book-page {
  position: relative;
  height: 100%;
  min-height: inherit;
  padding: 1.6rem 1.6rem 1.6rem 2.1rem;
  transform-origin: left center;
  transition: transform 0.28s ease, opacity 0.28s ease;
  cursor: ew-resize;
}

.book-page.flip-next {
  transform: rotateY(-18deg) translateX(8px);
  opacity: 0.35;
}

.book-page.flip-prev {
  transform: rotateY(18deg) translateX(-8px);
  opacity: 0.35;
}

.book-empty {
  min-height: inherit;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 0.4rem;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
}

.book-empty p {
  margin: 0;
}

.flip-photo {
  margin: 0;
  height: 100%;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.flip-photo img {
  width: 100%;
  flex: 1;
  max-height: min(48vh, 430px);
  object-fit: contain;
  border-radius: 14px;
  background: rgba(92, 36, 24, 0.06);
  border: 1px solid rgba(156, 69, 44, 0.15);
  box-shadow: 0 10px 28px rgba(58, 22, 16, 0.12);
}

.flip-photo figcaption {
  text-align: center;
}

.flip-photo figcaption strong {
  display: block;
  font-family: var(--font-cn);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  color: var(--emerald-900);
}

.flip-photo figcaption small {
  color: var(--ink-muted);
}

.flip-entry {
  min-height: inherit;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.5rem 0.4rem;
}

.flip-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}

.flip-top h2 {
  margin: 0;
  font-family: var(--font-cn);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  letter-spacing: 0.08em;
  color: var(--emerald-900);
}

.flip-date,
.flip-author {
  margin: 0 0 0.85rem;
  color: #7a6a3d;
  letter-spacing: 0.08em;
  font-size: 0.92rem;
}

.flip-body {
  margin: 0;
  font-family: var(--font-cn);
  font-size: 1.12rem;
  line-height: 1.85;
  color: #1d3a2f;
  white-space: pre-wrap;
}

.flip-msg-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  font-family: var(--font-cn);
  color: var(--emerald-800);
}

.flip-msg-head small {
  color: var(--ink-muted);
  font-family: var(--font-body);
}

.wish-flip {
  position: relative;
  padding: 1.5rem;
  border-radius: 12px;
  background:
    radial-gradient(circle at 90% 10%, rgba(232, 213, 163, 0.35), transparent 35%),
    linear-gradient(160deg, rgba(255, 192, 150, 0.25), rgba(255, 255, 255, 0.55));
  border: 1px dashed rgba(196, 92, 50, 0.35);
}

.wish-flip.fulfilled {
  opacity: 0.82;
}

.wish-status {
  position: absolute;
  top: 0.8rem;
  right: 0.9rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(212, 185, 120, 0.7);
  color: #7a6a3d;
  background: rgba(232, 213, 163, 0.45);
}

.book-nav {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(212, 185, 120, 0.4);
  background: rgba(92, 36, 24, 0.7);
  color: var(--ivory);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.book-nav:hover {
  transform: scale(1.06);
  border-color: var(--gold-soft);
  background: rgba(196, 92, 50, 0.85);
}

.book-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  margin-bottom: 0.45rem;
  color: var(--emerald-200);
  letter-spacing: 0.1em;
}

.book-hint {
  text-align: center;
  margin: 0 0 1.8rem;
  font-size: 0.82rem;
  color: rgba(184, 240, 220, 0.55);
  letter-spacing: 0.06em;
}

/* Music / Letters / Map extras */
.song-flip h2,
.letter-flip h2,
.map-flip h2 {
  margin: 0.55rem 0 0.35rem;
  font-family: var(--font-cn);
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: 0.08em;
  color: var(--emerald-900);
}

.flip-artist {
  margin: 0 0 1rem;
  color: #7a6a3d;
  letter-spacing: 0.06em;
}

.song-link {
  display: inline-flex;
  margin-top: 1rem;
  align-self: flex-start;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--emerald-600), var(--emerald-800));
  color: var(--ivory) !important;
  text-decoration: none;
  letter-spacing: 0.06em;
  font-size: 0.88rem;
  box-shadow: 0 8px 18px rgba(156, 69, 44, 0.25);
}

.book-letter {
  min-height: min(56vh, 520px);
}

.letter-flip {
  justify-content: flex-start;
  padding-top: 0.8rem;
}

.letter-meta {
  margin: 0 0 0.6rem;
  color: #7a6a3d;
  letter-spacing: 0.08em;
  font-size: 0.9rem;
}

.letter-body {
  max-height: min(36vh, 320px);
  overflow: auto;
  padding-right: 0.35rem;
}

.letter-sign {
  margin: 1.2rem 0 0;
  text-align: right;
  font-family: var(--font-cn);
  color: var(--emerald-800);
  letter-spacing: 0.08em;
}

.map-flip .fp-coords {
  margin: 0.9rem 0 0;
  font-size: 0.85rem;
  color: #7a6a3d;
  letter-spacing: 0.04em;
}

.map-panel {
  position: relative;
  margin: 0 0 1.6rem;
  padding: 1.2rem 1.1rem 1rem;
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(122, 52, 34, 0.58), rgba(58, 22, 16, 0.72));
  border: 1px solid var(--glass-border);
  overflow: hidden;
}

.map-panel-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-cn);
  letter-spacing: 0.12em;
  color: var(--gold-bright);
  font-size: 1.1rem;
}

.footprint-map {
  height: min(42vh, 380px);
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(212, 185, 120, 0.3);
  z-index: 1;
}

.map-tip {
  margin: 0.65rem 0 0;
  font-size: 0.8rem;
  color: rgba(184, 240, 220, 0.6);
  letter-spacing: 0.04em;
}

.feature-slot .portal-go {
  display: inline-block;
  margin-top: 0.85rem;
}

.nav {
  max-width: 100%;
}

@media (max-width: 900px) {
  .nav {
    font-size: 0.82rem;
    gap: 0.35rem 0.75rem;
  }
}

@media (max-width: 720px) {
  .book-shell {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .book {
    width: 100%;
    min-height: 52vh;
    order: 1;
  }

  .book-nav {
    order: 2;
  }

  .book-nav.prev { justify-self: start; }
  .book-nav.next { justify-self: end; margin-top: -54px; }

  .book-page {
    padding: 1.2rem 1.1rem 1.2rem 1.7rem;
  }

  .portal-card-wide {
    grid-column: auto;
  }
}
