:root {
  --color-primary: linear-gradient(135deg, #f6b0ff, #8aa4ff);
  --color-primary-solid: #d28bff;
  --color-secondary: rgba(255, 255, 255, 0.65);
  --color-text: #2c2144;
  --color-text-secondary: rgba(44, 33, 68, 0.7);
  --color-background: rgba(255, 255, 255, 0.15);
  --color-border: rgba(255, 255, 255, 0.25);
  --card-radius: 24px;
  --shadow-soft: 0 20px 60px rgba(114, 32, 224, 0.25);
  --shadow-glass: 0 16px 40px rgba(255, 255, 255, 0.2);
  --transition-fast: 160ms cubic-bezier(0.4, 0, 0.2, 1);
  color-scheme: light;
}

body.theme-dark {
  --color-secondary: rgba(23, 24, 42, 0.78);
  --color-text: #f5f2ff;
  --color-text-secondary: rgba(245, 242, 255, 0.7);
  --color-background: rgba(44, 35, 69, 0.45);
  --color-border: rgba(159, 125, 255, 0.35);
  --shadow-soft: 0 20px 70px rgba(40, 18, 73, 0.6);
  color-scheme: dark;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Noto Sans SC', 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at top left, rgba(255, 211, 252, 0.8), rgba(199, 205, 255, 0.35) 40%, rgba(48, 18, 98, 0.8) 100%);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.background {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.gradient-layer {
  background: linear-gradient(135deg, rgba(255, 215, 255, 0.8), rgba(168, 197, 255, 0.6));
  filter: blur(40px);
}

.star-layer {
  background-image:
    radial-gradient(2px 2px at 20% 20%, rgba(255, 255, 255, 0.6) 50%, transparent 60%),
    radial-gradient(1px 1px at 40% 60%, rgba(255, 255, 255, 0.45) 40%, transparent 50%),
    radial-gradient(2px 2px at 70% 30%, rgba(255, 255, 255, 0.7) 50%, transparent 55%),
    radial-gradient(1px 1px at 80% 80%, rgba(255, 255, 255, 0.55) 50%, transparent 60%);
  animation: sparkle 12s ease-in-out infinite alternate;
}

.heart-layer::before,
.heart-layer::after {
  content: '';
  position: absolute;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle at center, rgba(255, 142, 197, 0.45), transparent 70%);
  filter: blur(20px);
  animation: float 18s ease-in-out infinite;
}

.heart-layer::after {
  top: 30%;
  left: 65%;
  animation-delay: -6s;
  background: radial-gradient(circle at center, rgba(170, 179, 255, 0.45), transparent 70%);
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 32px 16px 48px;
}

.top-header {
  text-align: center;
  margin-bottom: 28px;
  padding: 24px 18px;
  border-radius: var(--card-radius);
  backdrop-filter: blur(18px);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  position: relative;
}

.top-header::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.2);
  opacity: 0.6;
  pointer-events: none;
}

.branding {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 8vw, 56px);
  margin-bottom: 10px;
}

.avatar-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: clamp(104px, 26vw, 180px);
  height: clamp(104px, 26vw, 180px);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', 'Noto Sans SC', sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 8vw, 3.2rem);
  color: #fff;
  box-shadow: 0 18px 36px rgba(83, 54, 137, 0.38);
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: linear-gradient(135deg, #f6b0ff, #8aa4ff);
  position: relative;
  overflow: hidden;
}

.avatar-name {
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(43, 33, 65, 0.78);
}

.heart-symbol {
  font-size: clamp(2.8rem, 8vw, 3.6rem);
  filter: drop-shadow(0 12px 28px rgba(255, 105, 180, 0.35));
}

.brand-title {
  margin: 6px 0 16px;
  font-family: 'Nunito', 'Noto Sans SC', sans-serif;
  font-weight: 600;
  font-size: clamp(1.25rem, 4.5vw, 2.1rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text);
  text-align: center;
}

.avatar-dq {
  background: linear-gradient(135deg, #8db6ff, #a18bff);

}

.avatar-xx {
  background: linear-gradient(135deg, #ffb0d7, #ff8fb1);

}

.avatar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.28), transparent 62%);
  z-index: -1;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

body.theme-dark .avatar-name {
  color: rgba(245, 242, 255, 0.82);
}

.emoji {
  font-size: 1.4rem;
}

.theme-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 56px;
  height: 56px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.6);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(18px);
  cursor: pointer;
  box-shadow: 0 20px 45px rgba(134, 107, 255, 0.38);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  z-index: 12;
}

.theme-toggle:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 24px 60px rgba(112, 86, 214, 0.45);
}

.theme-toggle .icon {
  display: none;
  font-size: 1.3rem;
}

.theme-toggle .sun {
  display: inline-block;
}

body.theme-dark .theme-toggle .sun {
  display: none;
}

body.theme-dark .theme-toggle .moon {
  display: inline-block;
}

.tagline {
  margin: 8px auto 16px;
  max-width: 420px;
  font-size: 1rem;
  color: var(--color-text-secondary);
}

.live-clock {
  font-family: 'Nunito', sans-serif;
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--color-text);
}

.tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px auto 28px;
  padding: 8px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 20px 40px rgba(141, 120, 216, 0.25);
  overflow: hidden;
  width: min(100%, 560px);
}

.tab-button {
  flex: 1 1 0;
  min-width: 72px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-family: 'Nunito', 'Noto Sans SC', sans-serif;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.35);
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
  backdrop-filter: blur(12px);
}

.tab-button:hover {
  transform: translateY(-2px);
}

.tab-button.active {
  background: linear-gradient(120deg, rgba(255, 199, 244, 0.9), rgba(167, 198, 255, 0.9));
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 14px 40px rgba(176, 129, 255, 0.4);
}

.panels {
  display: grid;
  gap: 20px;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 20px;
  animation: fadeUp 360ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tab-panel.active {
  display: flex;
}

.card,
.love-letter__content {
  border-radius: var(--card-radius);
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(18px);
  padding: 24px;
  box-shadow: var(--shadow-soft);
  position: relative;
}

body.theme-dark .card,
body.theme-dark .love-letter__content {
    background: rgba(37, 28, 60, 0.7);
}

body.theme-dark .card.highlight .headline-label,
body.theme-dark .card.highlight .headline-tail {
    color: rgba(245, 242, 255, 0.82);
}
.card.highlight {
  background: linear-gradient(135deg, rgba(255, 183, 242, 0.7), rgba(160, 189, 255, 0.75));
  color: #2b2141;
  min-height: clamp(220px, 32vw, 280px);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}

.card.highlight h2 {
    margin: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: clamp(1rem, 2.8vw, 1.3rem);
    letter-spacing: 0.08em;
  }

.card.highlight .headline-label,
.card.highlight .headline-tail {
    font-weight: 600;
    font-size: clamp(0.95rem, 2.4vw, 1.15rem);
    letter-spacing: 0.12em;
    color: rgba(43, 33, 65, 0.78);
}

.card.highlight .day-count {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(200px, 32vw, 260px);
    aspect-ratio: 0.9;
    font-size: clamp(3.4rem, 11vw, 5.4rem);
    font-weight: 800;
    line-height: 1;
    color: #ffffff;
    text-shadow: 0 12px 28px rgba(120, 70, 150, 0.32);
    z-index: 1;
    font-weight: 2000;
}

.card.highlight .day-count::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(255, 231, 245, 0.98), rgba(255, 180, 214, 0.92));
    filter: drop-shadow(0 28px 52px rgba(255, 170, 214, 0.45));
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 90'%3E%3Cpath d='M50 88L12 50C-4 32 2 6 26 6c12 0 21 7 24 17 3-10 12-17 24-17 24 0 30 26 14 44z' fill='white'/%3E%3C/svg%3E");
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 90'%3E%3Cpath d='M50 88L12 50C-4 32 2 6 26 6c12 0 21 7 24 17 3-10 12-17 24-17 24 0 30 26 14 44z' fill='white'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    clip-path: path('M 50% 96% C 12% 72%, 2% 46%, 16% 26% C 28% 8%, 46% 16%, 50% 30% C 54% 16%, 72% 8%, 84% 26% C 98% 46%, 88% 72%, 50% 96% Z');
    -webkit-clip-path: path('M 50% 96% C 12% 72%, 2% 46%, 16% 26% C 28% 8%, 46% 16%, 50% 30% C 54% 16%, 72% 8%, 84% 26% C 98% 46%, 88% 72%, 50% 96% Z');
    z-index: -2;
}

.card h3 {
  margin-top: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.card-desc,
.card-date {
  margin: 8px 0 0;
  color: var(--color-text-secondary);
}

.card-grid {
  display: grid;
  gap: 20px;
}

.card.glass {
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: var(--shadow-glass);
}

.metrics {
  margin: 0;
}

.metric {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.4);
}

.metric:last-child {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.metric dt {
  font-weight: 500;
  color: var(--color-text-secondary);
}

.metric dd {
  margin: 6px 0 0;
  font-size: 1.2rem;
  font-family: 'Nunito', sans-serif;
  letter-spacing: 0.02em;
}

.mini-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  width: 100%;
}

.mini-timeline .badge {
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.9rem;
  color: var(--color-text);
  display: block;
}

body.theme-dark .mini-timeline .badge {
  background: rgba(90, 74, 128, 0.65);
  color: #f5f2ff;
}

.birthday-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.wish-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.wish-list li {
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.4);
  font-size: 0.95rem;
  color: var(--color-text);
  position: relative;
}

.wish-list li::before {
  content: '🌠';
  margin-right: 6px;
}

.album {
  display: grid;
  gap: 16px;
}

.slider {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--card-radius) - 4px);
}

.slides {
  display: flex;
  transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.slide {
  min-width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  padding: 28px;
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
}

body.theme-dark .slide {
  background: rgba(36, 30, 52, 0.7);
}

.slide__visual {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, rgba(255, 182, 238, 0.8), rgba(170, 198, 255, 0.8));
}

.slide__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slide__info h4 {
  margin: 0 0 12px;
  font-size: 1.3rem;
}

.slide__info time {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.slider-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: rgba(255, 255, 255, 0.65);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  transition: transform var(--transition-fast);
}

.slider-control:hover {
  transform: translateY(-50%) scale(1.06);
}

.slider-control.prev {
  left: 16px;
}

.slider-control.next {
  right: 16px;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.dot.active {
  transform: scale(1.25);
  background: rgba(255, 255, 255, 0.9);
}

.love-wall {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.love-wall li {
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.4);
  color: var(--color-text);
}

.love-letter {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.love-letter.active {
  display: flex;
}

.love-letter__overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 14, 46, 0.6);
  backdrop-filter: blur(6px);
}

.love-letter__content {
  position: relative;
  max-width: 420px;
  width: calc(100% - 48px);
  text-align: left;
  animation: scaleIn 280ms ease;
}

.love-letter__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  font-size: 1.4rem;
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
}

.celebration {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  display: none;
  align-items: center;
  justify-content: center;
}

.celebration.active {
  display: flex;
}

.celebration__text {
  font-size: clamp(1.4rem, 5vw, 2.8rem);
  color: #fff;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.confetti {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.9) 12%, transparent 14%);
  background-size: 30px 30px;
  opacity: 0.4;
  animation: confettiFall 6s linear infinite;
}

.confetti--2 {
  animation-duration: 7s;
  opacity: 0.6;
}

.confetti--3 {
  animation-duration: 9s;
  opacity: 0.35;
}

.love-letter-trigger {
  margin-top: 18px;
  padding: 12px 18px;
  border-radius: 999px;
  border: none;
  font-size: 1rem;
  background: linear-gradient(120deg, rgba(255, 182, 222, 0.9), rgba(168, 192, 255, 0.9));
  color: #2b2141;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(150, 125, 255, 0.4);
  transition: transform var(--transition-fast);
}

.love-letter-trigger:hover {
  transform: translateY(-2px);
}

.page-footer {
  margin-top: auto;
  text-align: center;
  padding: 20px 12px 0;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

.page-footer .footer-meta {
  margin-top: 6px;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

@media (min-width: 720px) {
  .page {
    padding: 48px 42px 64px;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card {
    padding: 28px 32px;
  }

  .theme-toggle {
    right: 36px;
    bottom: 36px;
    width: 60px;
    height: 60px;
  }
}

@media (min-width: 1040px) {
  .page {
    max-width: 1080px;
    margin: 0 auto;
  }
}

@media (max-width: 360px) {
  .card.highlight .day-count {
    min-width: 0;
    width: 100%;
  }
}

@supports not (mask-image: linear-gradient(#000, #000)) {
  .card.highlight .day-count::before {
    mask-image: none;
    -webkit-mask-image: none;
    clip-path: polygon(50% 100%, 6% 62%, 10% 32%, 28% 12%, 50% 32%, 72% 12%, 90% 32%, 94% 62%);
    -webkit-clip-path: polygon(50% 100%, 6% 62%, 10% 32%, 28% 12%, 50% 32%, 72% 12%, 90% 32%, 94% 62%);
  }
}

@keyframes sparkle {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(0, -20px, 0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translate3d(-10%, -10%, 0) scale(1);
  }
  50% {
    transform: translate3d(5%, 15%, 0) scale(1.1);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes confettiFall {
  from {
    transform: translate3d(0, -100%, 0);
  }
  to {
    transform: translate3d(0, 100%, 0);
  }
}
