@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;700;900&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  font-family: 'Noto Sans TC', -apple-system, sans-serif;
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
  background: #2a1a3e;
}
.bg-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,215,0,0.3), rgba(220,20,60,0.3), rgba(139,0,0,0.3));
  z-index: -2;
}

.phone-frame {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: #fffaf0;
  position: relative;
  box-shadow: 0 10px 40px rgba(220,20,60,0.3);
}

.screen {
  width: 100%;
  min-height: 100vh;
  padding: 0 0 90px;
  display: none;
  position: relative;
}
.screen.active { display: block; }

.nav-dots {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 20;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(220,20,60,0.3); }
.dot.active { background: #DC143C; width: 20px; border-radius: 4px; }

.hero {
  position: relative;
  height: 280px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  background: #2a1a3e;
}
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.65;
}
.hero-content {
  position: relative;
  z-index: 2;
  background: linear-gradient(0deg, rgba(220,20,60,0.95), rgba(220,20,60,0.7) 70%, transparent);
  width: 100%;
  padding: 24px;
  text-align: center;
}
.hero-content h1 {
  font-size: 30px;
  color: #FFD700;
  font-weight: 900;
  text-shadow: 2px 2px 0 #000;
  margin-bottom: 4px;
}
.hero-content .sub {
  color: #FFE5B4;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}
.hero-content .day-tag {
  display: inline-block;
  padding: 4px 12px;
  background: #FFD700;
  color: #DC143C;
  border-radius: 12px;
  font-weight: 900;
  font-size: 12px;
}

.bgm-control {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 30;
  background: rgba(255,255,255,0.9);
  border-radius: 50px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 11px;
  color: #DC143C;
  font-weight: 700;
}
.bgm-control .icon { font-size: 14px; animation: music-spin 3s linear infinite; display: inline-block; }
@keyframes music-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.bgm-control.muted .icon { animation: none; }

.profile-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 30;
  background: rgba(255,255,255,0.9);
  border-radius: 50px;
  padding: 4px 12px 4px 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 160px;
}
.profile-pill img { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; }
.profile-pill .name {
  font-size: 11px;
  color: #DC143C;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.content-area { padding: 14px 16px; position: relative; z-index: 3; }

.streak-banner {
  background: linear-gradient(90deg, #DC143C, #FFD700, #DC143C);
  background-size: 200% 100%;
  color: white;
  padding: 8px 16px;
  border-radius: 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 12px;
  animation: shimmer 3s linear infinite;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}
@keyframes shimmer { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }

.merit-bar {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  border: 2px solid #DC143C;
  border-radius: 14px;
  padding: 10px 16px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 12px rgba(255,215,0,0.4);
}
.merit-bar .label { color: #8B0000; font-size: 13px; font-weight: 700; }
.merit-bar .count { color: #DC143C; font-size: 24px; font-weight: 900; text-shadow: 1px 1px 0 #FFD700; }

.windmill {
  width: 130px;
  height: 130px;
  margin: 12px auto;
  background: radial-gradient(circle, #FFD700, #DC143C);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 70px;
  box-shadow: 0 8px 24px rgba(220,20,60,0.4);
  animation: windmill-spin 4s linear infinite;
}
@keyframes windmill-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.sign-chips { display: flex; gap: 6px; margin: 10px 0; justify-content: center; }
.sign-chip {
  background: white;
  border: 2px solid #E0E0E0;
  border-radius: 50px;
  padding: 5px 10px;
  font-size: 11px;
  color: #888;
  font-weight: 700;
  flex: 1;
  text-align: center;
}
.sign-chip.signed { background: #FFD700; color: #DC143C; border-color: #FFD700; }
.sign-chip.today {
  background: linear-gradient(135deg, #DC143C, #FFD700);
  color: white;
  border-color: #FFD700;
  box-shadow: 0 0 12px rgba(220,20,60,0.7);
}

.hk-btn {
  display: block;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #DC143C, #8B0000);
  color: #FFD700;
  border: 2px solid #FFD700;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  margin: 10px 0;
  box-shadow: 0 6px 16px rgba(220,20,60,0.4);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
  transition: all 0.2s;
}
.hk-btn:active { transform: scale(0.96); }
.hk-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.hk-btn-secondary { background: #fff; color: #DC143C; border: 2px solid #DC143C; box-shadow: none; text-shadow: none; }

.rewards { background: white; border-radius: 14px; padding: 12px; margin: 12px 0; }
.rewards .title { color: #DC143C; font-weight: 900; margin-bottom: 8px; text-align: center; font-size: 13px; }
.tier-row {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  margin: 4px 0;
  border-radius: 8px;
  background: #fff8f0;
  border-left: 3px solid #DC143C;
  font-size: 12px;
}
.tier-row.unlocked {
  background: linear-gradient(90deg, #FFD700, #fff8f0);
  border-left-color: #FFD700;
  animation: tier-glow 2s ease-in-out infinite;
}
@keyframes tier-glow {
  0%, 100% { box-shadow: 0 0 4px rgba(255,215,0,0.5); }
  50% { box-shadow: 0 0 12px rgba(255,215,0,0.9); }
}
.tier-row .emoji { font-size: 18px; margin-right: 6px; }
.tier-row .name { color: #DC143C; font-weight: 700; flex: 1; }
.tier-row .pts { color: #8B0000; font-weight: 900; margin-right: 6px; }
.tier-row .check { color: #4CAF50; font-weight: 900; font-size: 10px; min-width: 46px; text-align: right; }

.hk-cross-sell {
  background: linear-gradient(135deg, #DC143C, #8B0000);
  border: 2px dashed #FFD700;
  border-radius: 14px;
  padding: 14px;
  margin-top: 14px;
  text-align: center;
  color: #FFD700;
}
.hk-cross-sell h4 { font-size: 14px; margin-bottom: 6px; }
.hk-cross-sell p { font-size: 11px; margin-bottom: 10px; opacity: 0.95; }
.hk-buy-btn { background: #FFD700; color: #8B0000; padding: 10px 20px; border-radius: 50px; border: none; font-weight: 900; font-size: 12px; cursor: pointer; }

.spinner-area { text-align: center; padding: 40px 0; }
.hk-mystery {
  width: 240px;
  height: 240px;
  margin: 0 auto;
  background: radial-gradient(circle, #FFD700 30%, #DC143C 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 130px;
  box-shadow: 0 0 60px rgba(255,215,0,0.8);
  animation: fast-spin 1s linear infinite;
}
@keyframes fast-spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.08); }
  100% { transform: rotate(360deg) scale(1); }
}

.hk-fortune-card {
  position: relative;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  border: 4px solid #DC143C;
  border-radius: 18px;
  overflow: hidden;
  margin: 12px 0;
  color: #8B0000;
}
.fortune-overlay { position: relative; height: 110px; overflow: hidden; }
.fortune-overlay img { width: 100%; height: 100%; object-fit: cover; opacity: 0.45; }
.fortune-overlay-badge {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.4);
  color: #FFD700;
  font-size: 14px;
  font-weight: 900;
}
.fortune-body { padding: 14px; }
.hk-fortune-card .rank {
  display: inline-block;
  padding: 6px 14px;
  background: linear-gradient(135deg, #DC143C, #8B0000);
  color: #FFD700;
  border-radius: 50px;
  font-weight: 900;
  font-size: 16px;
  margin-bottom: 8px;
  border: 1px solid #FFD700;
}
.hk-fortune-card .canto { color: #DC143C; font-size: 14px; text-align: center; font-weight: 700; margin: 8px 0; }
.hk-fortune-card .score {
  text-align: center; color: #DC143C; font-size: 42px; font-weight: 900; margin: 6px 0;
  text-shadow: 2px 2px 0 #FFD700;
}
.hk-fortune-card .commentary {
  background: rgba(255,255,255,0.85);
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: #3d0000;
  margin-top: 8px;
}

.aspect-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 10px 0;
}
.aspect-chip {
  background: white;
  border-radius: 10px;
  padding: 6px 2px;
  text-align: center;
}
.aspect-chip .a-name { font-size: 10px; color: #8B0000; font-weight: 700; }
.aspect-chip .a-score { font-size: 15px; color: #DC143C; font-weight: 900; margin-top: 2px; }
.aspect-chip.spotlight { background: linear-gradient(135deg, #FFD700, #FFA500); box-shadow: 0 0 8px rgba(255,215,0,0.8); }

.mazu-mini {
  background: linear-gradient(135deg, rgba(255,215,0,0.95), rgba(255,165,0,0.95));
  border: 2px solid #DC143C;
  border-radius: 14px;
  padding: 10px;
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.mazu-mini img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
.mazu-mini .text { flex: 1; }
.mazu-mini .text .title { color: #DC143C; font-weight: 900; font-size: 13px; }
.mazu-mini .text .canto { color: #8B0000; font-size: 11px; margin-top: 2px; }

@media (min-width: 431px) {
  body { display: flex; justify-content: center; }
  .phone-frame { max-width: 430px; margin: 0 auto; border-left: 1px solid #eee; border-right: 1px solid #eee; }
}
