/* =======================================================
   🌺 花开富贵 · 万事如意 · 徐舒琪 16 岁生辰大吉 🌺
   古早 Flash & 中老年表情包特供豪华大狂欢视觉系统
   ======================================================= */

:root {
  --gold-sun: #ffd700;
  --festive-red: #d32f2f;
  --neon-pink: #ff1493;
  --emerald-green: #00e676;
  --peony-purple: #9c27b0;
  --flash-cyan: #00ffff;
  --border-gold: #ffec3d;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  min-height: 100%;
  background: radial-gradient(circle at center, #8b0000 0%, #4a0000 60%, #1a0000 100%);
  color: #fff;
  font-family: 'SimSun', 'STSong', 'Microsoft YaHei', sans-serif;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* 🌟 1. 佛光普照金光放射背景 Canvas */
#sunburst-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  opacity: 0.65;
}

/* 全屏花瓣与金币飘落 Canvas */
#fall-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  pointer-events: none;
}

/* ==================== 页面主体容器 ==================== */
.main-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 12px 90px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* ==================== 顶部七彩跑马灯 ==================== */
.marquee-box {
  width: 100%;
  background: linear-gradient(90deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
  background-size: 400% 400%;
  animation: rainbowFlow 4s linear infinite;
  padding: 3px;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 0, 128, 0.5);
}

.marquee-inner {
  background: #2b0000;
  border-radius: 9px;
  padding: 8px 12px;
  overflow: hidden;
  white-space: nowrap;
}

.marquee-text {
  display: inline-block;
  font-size: 15px;
  font-weight: bold;
  color: #ffff00;
  text-shadow: 2px 2px 0 #ff0000, -2px -2px 0 #ff0000, 2px -2px 0 #ff0000, -2px 2px 0 #ff0000;
  animation: marqueeRoll 16s linear infinite;
  letter-spacing: 2px;
}

/* ==================== 顶部音乐播放小喇叭 ==================== */
.music-control-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 999;
  background: radial-gradient(circle, #ffeb3b, #f57f17);
  border: 2px solid #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 0 15px #ffd700;
}

.music-control-btn.playing {
  animation: spinTrumpet 2.5s linear infinite;
}

/* ==================== 核心大标题：富贵吉祥 ==================== */
.grand-header {
  text-align: center;
  margin-top: 6px;
}

.title-sub {
  font-size: 13px;
  color: #00ffea;
  letter-spacing: 4px;
  font-weight: bold;
  text-shadow: 0 0 8px #00ffff;
  animation: flashText 1s infinite alternate;
}

.title-main {
  font-size: 34px;
  font-weight: 900;
  color: #ffeb3b;
  text-shadow: 
    3px 3px 0 #ff0000,
    -3px -3px 0 #ff0000,
    3px -3px 0 #ff0000,
    -3px 3px 0 #ff0000,
    0 0 20px #ff00de,
    0 0 35px #ffff00;
  letter-spacing: 4px;
  margin: 4px 0;
  animation: pulseScale 1.5s infinite alternate ease-in-out;
}

.title-blessing {
  font-size: 16px;
  color: #ffffff;
  font-weight: bold;
  letter-spacing: 3px;
  text-shadow: 1px 1px 4px #000, 0 0 10px #ff9800;
}

/* ==================== 核心照片舞台：3D 托马斯翻滚与八方来财金相框 ==================== */
.stage-card {
  width: 100%;
  background: rgba(30, 0, 0, 0.75);
  border: 4px double #ffd700;
  border-radius: 20px;
  padding: 16px 12px;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.5), inset 0 0 20px rgba(255, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* 顶部装饰牡丹花双角 */
.peony-flower {
  position: absolute;
  font-size: 36px;
  animation: spinFlower 6s linear infinite;
  z-index: 15;
}
.peony-left { top: -14px; left: -10px; }
.peony-right { top: -14px; right: -10px; animation-direction: reverse; }

/* 3D 舞台视口 */
.photo-viewport {
  width: 260px;
  height: 310px;
  perspective: 1000px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0 14px;
  cursor: pointer;
}

.photo-3d-box {
  width: 230px;
  height: 285px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.4s ease;
}

/* 模式 1: 托马斯 3D 旋转翻滚 (默认模式) */
.photo-3d-box.mode-thomas {
  animation: thomasRoll 6s infinite ease-in-out;
}

/* 模式 2: 魔性疯狂左右摇摆 (魔性舞动) */
.photo-3d-box.mode-shake {
  animation: salsaShake 0.4s infinite alternate ease-in-out;
}

/* 模式 3: 莲花升降漂浮 */
.photo-3d-box.mode-float {
  animation: lotusFloat 3s infinite ease-in-out;
}

/* 金镶玉富贵相框 */
.gold-frame {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #ffd700 0%, #ff8f00 50%, #fff176 100%);
  padding: 8px;
  border-radius: 16px;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.8),
    0 0 25px rgba(255, 235, 59, 0.9),
    inset 0 0 15px rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
}

.photo-inner {
  width: 100%;
  height: 220px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #fff;
  background: #000;
  position: relative;
}

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

.sparkle-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, transparent 40%, rgba(255, 215, 0, 0.3) 100%);
  pointer-events: none;
}

.frame-caption {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #8b0000;
  font-weight: 900;
  font-size: 12px;
  padding: 0 4px;
}

/* 照片动作控制器按钮行 */
.motion-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 6px;
}

.btn-fugui {
  background: linear-gradient(180deg, #ffeb3b 0%, #ff9800 100%);
  color: #8b0000;
  font-weight: 900;
  font-size: 12px;
  border: 2px solid #fff;
  border-radius: 20px;
  padding: 8px 14px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.8);
  transition: transform 0.1s;
}

.btn-fugui:active {
  transform: scale(0.92);
}

/* ==================== 互动 1: 富贵功德电子木鱼 / 寿桃 ==================== */
.interactive-card {
  width: 100%;
  background: linear-gradient(135deg, rgba(74, 20, 140, 0.85) 0%, rgba(136, 14, 79, 0.85) 100%);
  border: 2px solid #ff4081;
  border-radius: 18px;
  padding: 16px 14px;
  box-shadow: 0 0 20px rgba(255, 64, 129, 0.4);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.card-heading {
  font-size: 18px;
  font-weight: 900;
  color: #ffeb3b;
  text-shadow: 2px 2px 0 #d81b60;
  margin-bottom: 8px;
}

.muyu-stage {
  position: relative;
  width: 140px;
  height: 120px;
  margin: 10px auto;
  cursor: pointer;
}

.muyu-icon {
  font-size: 72px;
  transition: transform 0.08s ease;
}

.muyu-stage:active .muyu-icon {
  transform: scale(0.85) rotate(-8deg);
}

.muyu-count-box {
  display: inline-block;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #ffd700;
  border-radius: 15px;
  padding: 4px 14px;
  font-size: 13px;
  color: #00e676;
  font-weight: bold;
  margin-top: 4px;
}

/* 浮动功德气泡动画容器 */
.float-text-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.floating-merit {
  position: absolute;
  font-size: 18px;
  font-weight: 900;
  color: #ffd700;
  text-shadow: 0 0 8px #ff0000, 2px 2px 0 #000;
  animation: meritFloatUp 1.2s forwards ease-out;
  pointer-events: none;
  white-space: nowrap;
}

/* ==================== 互动 2: 经典“为我们的友谊干杯” ==================== */
.toast-banner {
  width: 100%;
  background: linear-gradient(90deg, #b71c1c, #e65100, #b71c1c);
  border: 3px double #fff;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 0 20px #ff6f00;
  cursor: pointer;
}

.toast-beer {
  font-size: 42px;
  animation: beerClink 1.2s infinite alternate ease-in-out;
}

.toast-text-box {
  text-align: center;
}

.toast-title {
  font-size: 18px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 2px 2px 0 #000, 0 0 10px #ffeb3b;
}

.toast-sub {
  font-size: 12px;
  color: #ffd700;
  margin-top: 3px;
}

/* ==================== 互动 3: 黄金寿桃生日大蛋糕 ==================== */
.cake-section {
  width: 100%;
  background: rgba(46, 125, 50, 0.8);
  border: 3px solid #76ff03;
  border-radius: 18px;
  padding: 16px 12px;
  text-align: center;
  box-shadow: 0 0 25px rgba(118, 255, 3, 0.4);
}

.cake-visual {
  font-size: 64px;
  margin: 8px 0;
  animation: bounceCake 1.5s infinite ease-in-out;
}

.btn-big-wish {
  background: linear-gradient(180deg, #ff1744 0%, #b71c1c 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  border: 3px solid #ffeb3b;
  border-radius: 30px;
  padding: 12px 28px;
  cursor: pointer;
  box-shadow: 0 0 20px #ff1744;
  letter-spacing: 2px;
  animation: pulseButton 1s infinite alternate;
}

.btn-big-wish:active {
  transform: scale(0.94);
}

/* ==================== 底部万年富贵对联 ==================== */
.couplet-box {
  width: 100%;
  background: #8b0000;
  border: 2px solid #ffd700;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  font-size: 13px;
  color: #ffd700;
  font-weight: bold;
  line-height: 1.8;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
}

/* ==================== 关键帧动画特辑 ==================== */
@keyframes rainbowFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes marqueeRoll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

@keyframes spinTrumpet {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}

@keyframes flashText {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}

@keyframes pulseScale {
  0% { transform: scale(0.96); }
  100% { transform: scale(1.04); }
}

@keyframes spinFlower {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 经典 3D 托马斯翻滚大回旋 */
@keyframes thomasRoll {
  0% { transform: rotateY(0deg) rotateX(0deg) rotateZ(0deg); }
  25% { transform: rotateY(90deg) rotateX(15deg) rotateZ(10deg) scale(1.08); }
  50% { transform: rotateY(180deg) rotateX(-15deg) rotateZ(0deg) scale(1); }
  75% { transform: rotateY(270deg) rotateX(15deg) rotateZ(-10deg) scale(1.08); }
  100% { transform: rotateY(360deg) rotateX(0deg) rotateZ(0deg); }
}

/* 疯狂摇摆舞动 */
@keyframes salsaShake {
  0% { transform: rotateZ(-16deg) scale(1.05) translateY(-5px); }
  100% { transform: rotateZ(16deg) scale(1.1) translateY(5px); }
}

/* 莲花升降漂浮 */
@keyframes lotusFloat {
  0%, 100% { transform: translateY(0px) rotateZ(0deg); }
  50% { transform: translateY(-20px) rotateZ(8deg) scale(1.06); }
}

@keyframes meritFloatUp {
  0% { opacity: 1; transform: translate(-50%, 0) scale(0.8); }
  50% { opacity: 1; transform: translate(-50%, -40px) scale(1.3); }
  100% { opacity: 0; transform: translate(-50%, -85px) scale(1.5); }
}

@keyframes beerClink {
  0% { transform: rotate(-10deg); }
  100% { transform: rotate(15deg) scale(1.1); }
}

@keyframes bounceCake {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15) rotate(3deg); }
}

@keyframes pulseButton {
  0% { box-shadow: 0 0 10px #ff1744; }
  100% { box-shadow: 0 0 30px #ffff00, 0 0 50px #ff1744; }
}

.hidden {
  display: none !important;
}
