/* 宝藏主题：稀有度、藏宝档案、开箱动画 */

:root {
  --treasure-gold: #FFD700;
  --treasure-brown: #5D4037;
  --rarity-common: #8D6E63;
  --rarity-rare: #546E7A;
  --rarity-epic: #F9A825;
  --rarity-legendary: #7B1FA2;
}

.treasure-rarity-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.treasure-rarity-badge.common { background: var(--rarity-common); }
.treasure-rarity-badge.rare { background: var(--rarity-rare); }
.treasure-rarity-badge.epic { background: var(--rarity-epic); color: #3e2723; }
.treasure-rarity-badge.legendary {
  background: linear-gradient(135deg, #7B1FA2, #E040FB);
}

.treasure-card.rarity-common { border-left: 4px solid var(--rarity-common); }
.treasure-card.rarity-rare { border-left: 4px solid var(--rarity-rare); }
.treasure-card.rarity-epic { border-left: 4px solid var(--rarity-epic); }
.treasure-card.rarity-legendary {
  border-left: 4px solid var(--rarity-legendary);
  box-shadow: 0 2px 12px rgba(123, 31, 162, 0.15);
}

.treasure-found-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(76, 175, 80, 0.92);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 12px;
  z-index: 2;
}

.treasure-card-wrap { position: relative; }

/* 藏宝档案 */
.archive-header {
  background: linear-gradient(135deg, #5D4037 0%, #8D6E63 100%);
  color: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 14px;
}

.archive-header h1 {
  font-size: 22px;
  margin-bottom: 6px;
}

.archive-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.archive-tag {
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 12px;
}

.archive-lore {
  background: #FFF8E1;
  border-left: 4px solid var(--treasure-gold);
  padding: 14px 16px;
  border-radius: 0 8px 8px 0;
  margin: 12px 0;
  line-height: 1.65;
  color: #5D4037;
}

.archive-rewards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.archive-reward-item {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  font-size: 13px;
}

.archive-reward-item strong {
  display: block;
  font-size: 18px;
  color: var(--treasure-brown);
  margin-bottom: 4px;
}

.fragment-item {
  background: #fafafa;
  border: 1px dashed #ccc;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}

.fragment-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--treasure-brown);
  margin-bottom: 6px;
}

/* 开箱 overlay */
.treasure-unbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: unboxFadeIn 0.3s ease;
}

.treasure-unbox-overlay.active { display: flex; }

@keyframes unboxFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes chestBounce {
  0%, 100% { transform: scale(1) rotate(0deg); }
  30% { transform: scale(1.15) rotate(-3deg); }
  60% { transform: scale(1.08) rotate(3deg); }
}

.treasure-unbox-card {
  background: linear-gradient(180deg, #fff 0%, #FFF8E1 100%);
  border-radius: 16px;
  max-width: 400px;
  width: 100%;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: chestBounce 0.6s ease;
}

.treasure-unbox-emoji {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 12px;
}

.treasure-unbox-title {
  font-size: 13px;
  color: #888;
  margin-bottom: 4px;
}

.treasure-unbox-name {
  font-size: 22px;
  font-weight: 800;
  color: #333;
  margin-bottom: 12px;
  line-height: 1.3;
}

.treasure-unbox-card-text {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  color: #555;
  line-height: 1.55;
  text-align: left;
  margin: 14px 0;
  white-space: pre-wrap;
}

.treasure-unbox-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 14px 0;
  font-size: 14px;
  color: #666;
}

.treasure-unbox-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.treasure-unbox-actions button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.treasure-unbox-btn-primary {
  background: linear-gradient(135deg, #FFD700, #FFA000);
  color: #3e2723;
}

.treasure-unbox-btn-secondary {
  background: #f0f0f0;
  color: #333;
}

/* 藏宝册 */
.album-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.album-stat {
  background: #fff;
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.album-stat-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--treasure-brown);
}

.album-stat-label { font-size: 11px; color: #888; margin-top: 2px; }

.album-set-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.album-set-progress {
  height: 6px;
  background: #eee;
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}

.album-set-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #FFD700, #FFA000);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.album-item {
  display: flex;
  gap: 12px;
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  cursor: pointer;
}

.album-item-cover {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  background: #e0e0e0;
  flex-shrink: 0;
}

.album-item-info { flex: 1; min-width: 0; }

.album-item-title {
  font-weight: 700;
  font-size: 15px;
  color: #333;
  margin-bottom: 4px;
}

.album-item-meta {
  font-size: 12px;
  color: #888;
  line-height: 1.45;
}

.album-item-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.album-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #f3f4f6;
  color: #475569;
}

.album-stat-chip.distance { background: #eff6ff; color: #1d4ed8; }
.album-stat-chip.time { background: #f0fdf4; color: #15803d; }
.album-stat-chip.accuracy { background: #fff7ed; color: #c2410c; }
.album-stat-chip.points { background: #fef3c7; color: #b45309; }

@media (max-width: 480px) {
  .album-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
