/* ============================================================
   Mythical Beast Collection — "Bestiary" Styles
   墨韵敦煌 — dark cinematic beast-hunting game aesthetic
   ============================================================ */

body.game-active .site-nav { display: none !important; }
body.game-active .site-footer { display: none !important; }

/* ============================================================
   1. Page Body
   ============================================================ */
body {
  background: #0d0a05;
  color: var(--text-on-dark);
  overflow-x: hidden;
}

/* ============================================================
   2. Main Stage & Phase System
   ============================================================ */
.bestiary-stage {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.bestiary-phase {
  display: none;
  width: 100%;
  height: 100%;
}

.bestiary-phase.active {
  display: flex;
}

/* ============================================================
   3. Living Map (山河社稷图)
   ============================================================ */
.map-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #0d0a05;
}

.map-bg-deep {
  position: absolute;
  top: 0;
  left: 0;
  width: 120%;
  height: 120%;
  transform: translate(
    calc(var(--parallax-x, 0) * -0.02),
    calc(var(--parallax-y, 0) * -0.02)
  );
  background:
    radial-gradient(ellipse 40% 30% at 20% 70%, rgba(30,50,40,0.6) 0%, transparent 70%),
    radial-gradient(ellipse 35% 25% at 70% 80%, rgba(40,30,20,0.5) 0%, transparent 65%),
    radial-gradient(ellipse 50% 35% at 50% 60%, rgba(20,35,45,0.4) 0%, transparent 60%),
    linear-gradient(180deg, #0d0a05 0%, #14100a 30%, #1a1510 50%, #161210 70%, #0d0a05 100%);
  pointer-events: none;
  z-index: 1;
}

.map-bg-mid {
  position: absolute;
  top: 0;
  left: 0;
  width: 115%;
  height: 115%;
  transform: translate(
    calc(var(--parallax-x, 0) * -0.04),
    calc(var(--parallax-y, 0) * -0.03)
  );
  background:
    radial-gradient(ellipse 25% 20% at 15% 55%, rgba(50,70,40,0.35) 0%, transparent 60%),
    radial-gradient(ellipse 30% 22% at 60% 65%, rgba(80,60,30,0.3) 0%, transparent 55%),
    radial-gradient(ellipse 20% 18% at 85% 45%, rgba(40,55,65,0.25) 0%, transparent 50%),
    radial-gradient(ellipse 45% 30% at 40% 75%, rgba(25,35,30,0.4) 0%, transparent 65%);
  pointer-events: none;
  z-index: 2;
}

.map-bg-fore {
  position: absolute;
  top: 0;
  left: 0;
  width: 110%;
  height: 110%;
  transform: translate(
    calc(var(--parallax-x, 0) * -0.07),
    calc(var(--parallax-y, 0) * -0.05)
  );
  background:
    radial-gradient(ellipse 18% 15% at 30% 50%, rgba(70,90,55,0.3) 0%, transparent 50%),
    radial-gradient(ellipse 15% 12% at 70% 55%, rgba(100,75,40,0.25) 0%, transparent 45%),
    radial-gradient(ellipse 20% 14% at 10% 65%, rgba(55,70,80,0.2) 0%, transparent 48%),
    radial-gradient(ellipse 12% 10% at 90% 60%, rgba(90,65,35,0.2) 0%, transparent 42%);
  pointer-events: none;
  z-index: 3;
}

.map-mist-1 {
  position: absolute;
  top: 0;
  left: -10%;
  width: 120%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.015) 20%,
    transparent 40%,
    rgba(255,255,255,0.02) 60%,
    transparent 80%,
    rgba(255,255,255,0.01) 100%
  );
  animation: mist-drift-1 18s ease-in-out infinite;
  pointer-events: none;
  z-index: 4;
}

.map-mist-2 {
  position: absolute;
  top: 0;
  left: -10%;
  width: 120%;
  height: 100%;
  background: linear-gradient(
    135deg,
    transparent 0%,
    rgba(232,220,200,0.018) 25%,
    transparent 50%,
    rgba(232,220,200,0.012) 75%,
    transparent 100%
  );
  animation: mist-drift-2 24s ease-in-out infinite;
  pointer-events: none;
  z-index: 4;
}

@keyframes mist-drift-1 {
  0%   { transform: translateX(-5%) scaleX(1); }
  50%  { transform: translateX(5%) scaleX(1.05); }
  100% { transform: translateX(-5%) scaleX(1); }
}

@keyframes mist-drift-2 {
  0%   { transform: translateX(8%) translateY(-2%) scaleX(0.95); }
  50%  { transform: translateX(-3%) translateY(3%) scaleX(1.03); }
  100% { transform: translateX(8%) translateY(-2%) scaleX(0.95); }
}

.map-regions {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

.region-hotspot {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  border: 2px solid rgba(255,255,255,0.15);
  background: radial-gradient(circle, rgba(120,180,255,0.08) 0%, transparent 70%);
  animation: region-pulse 2.5s ease-in-out infinite;
  transition: border-color 0.4s, background 0.4s, box-shadow 0.4s, transform 0.4s;
  z-index: 6;
}

.region-hotspot:hover {
  transform: scale(1.25);
  border-color: var(--accent-gold);
  background: radial-gradient(circle, rgba(184,160,110,0.15) 0%, transparent 70%);
  box-shadow: 0 0 30px rgba(184,160,110,0.25);
}

.region-hotspot.collected {
  border-color: var(--accent-gold);
  background: radial-gradient(circle, rgba(184,160,110,0.2) 0%, transparent 70%);
  box-shadow: 0 0 20px rgba(184,160,110,0.3), inset 0 0 20px rgba(184,160,110,0.1);
  animation: region-pulse-collected 3s ease-in-out infinite;
}

.region-hotspot.undiscovered {
  border-color: rgba(180,210,255,0.25);
  background: radial-gradient(circle, rgba(180,210,255,0.04) 0%, transparent 70%);
  box-shadow: 0 0 15px rgba(180,210,255,0.1);
  animation: region-pulse 2.5s ease-in-out infinite;
}

.region-hotspot .hotspot-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13,10,5,0.92);
  color: var(--text-on-dark);
  font-family: var(--font-chinese);
  font-size: 0.85rem;
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid rgba(184,160,110,0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  transform: translateX(-50%) translateY(4px);
}

.region-hotspot:hover .hotspot-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes region-pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50%      { opacity: 0.8; transform: scale(1.08); }
}

@keyframes region-pulse-collected {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.04); }
}

.map-header {
  position: absolute;
  top: var(--space-md);
  left: 0;
  width: 100%;
  text-align: center;
  z-index: 20;
  pointer-events: none;
  padding: 0 var(--space-md);
}

.map-header h1 {
  font-family: var(--font-chinese-display);
  font-size: 3rem;
  color: var(--text-on-dark);
  text-shadow: 0 0 20px rgba(184,160,110,0.25), 0 2px 8px rgba(0,0,0,0.6);
  margin-bottom: var(--space-xs);
  letter-spacing: 0.15em;
}

.map-header .map-subtitle {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  opacity: 0.85;
  margin-bottom: var(--space-sm);
}

.map-header .map-counter {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-on-dark);
  background: rgba(0,0,0,0.5);
  padding: 6px 20px;
  border-radius: 20px;
  border: 1px solid rgba(184,160,110,0.25);
  backdrop-filter: blur(4px);
}

.map-header .map-counter span {
  color: var(--accent-gold);
  font-weight: 700;
}

.map-actions {
  position: absolute;
  bottom: var(--space-lg);
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  z-index: 20;
  pointer-events: none;
}

.map-actions > * {
  pointer-events: auto;
}

/* ============================================================
   4. Particle Systems
   ============================================================ */

/* Particle Base */
.particle {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 250;
  opacity: 0;
}

/* Petal — fall + sway */
.particle-petal {
  background: radial-gradient(ellipse at 30% 30%, #e8b88a, #c47a4a);
  width: 10px;
  height: 14px;
  border-radius: 50% 0 50% 0;
  animation: particle-petal 8s ease-in-out infinite;
}

@keyframes particle-petal {
  0%   { transform: translateY(-10vh) rotate(0deg) translateX(0); opacity: 0; }
  10%  { opacity: 0.6; }
  50%  { transform: translateY(50vh) rotate(180deg) translateX(40px); opacity: 0.4; }
  90%  { opacity: 0.2; }
  100% { transform: translateY(110vh) rotate(360deg) translateX(-20px); opacity: 0; }
}

/* Firefly — float up + flicker opacity */
.particle-firefly {
  background: radial-gradient(circle, #ffffb0 0%, #e8d44a 40%, transparent 70%);
  width: 8px;
  height: 8px;
  box-shadow: 0 0 12px rgba(232,212,74,0.4);
  animation: particle-firefly 6s ease-in-out infinite;
}

@keyframes particle-firefly {
  0%   { transform: translateY(100vh) scale(0.8); opacity: 0; }
  20%  { opacity: 0.8; }
  40%  { transform: translateY(60vh) translateX(30px) scale(1.2); opacity: 1; }
  60%  { opacity: 0.5; transform: translateY(30vh) translateX(-20px) scale(0.9); }
  80%  { opacity: 0.9; }
  100% { transform: translateY(-10vh) scale(0.6); opacity: 0; }
}

/* Ember — rise + fade + drift */
.particle-ember {
  background: radial-gradient(circle, #ff8844 0%, #cc4422 60%, transparent 80%);
  width: 5px;
  height: 5px;
  box-shadow: 0 0 8px rgba(200,60,30,0.35);
  animation: particle-ember 5s ease-out infinite;
}

@keyframes particle-ember {
  0%   { transform: translateY(80vh) translateX(0) scale(0.5); opacity: 0.7; }
  30%  { transform: translateY(55vh) translateX(25px) scale(1.2); opacity: 0.9; }
  60%  { transform: translateY(28vh) translateX(-15px) scale(0.8); opacity: 0.5; }
  100% { transform: translateY(-5vh) translateX(10px) scale(0.3); opacity: 0; }
}

/* Snow — slow fall + slight lateral drift */
.particle-snow {
  background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(200,220,240,0.3) 70%);
  width: 4px;
  height: 4px;
  box-shadow: 0 0 6px rgba(200,220,240,0.2);
  animation: particle-snow 12s linear infinite;
}

@keyframes particle-snow {
  0%   { transform: translateY(-5vh) translateX(0); opacity: 0; }
  10%  { opacity: 0.7; }
  50%  { transform: translateY(50vh) translateX(35px); opacity: 0.5; }
  90%  { opacity: 0.2; }
  100% { transform: translateY(105vh) translateX(-15px); opacity: 0; }
}

/* Stardust — twinkle + slow rise */
.particle-stardust {
  background: radial-gradient(circle, #ffffff 0%, #d4c8f0 40%, transparent 70%);
  width: 3px;
  height: 3px;
  box-shadow: 0 0 10px rgba(212,200,240,0.5);
  animation: particle-stardust 10s ease-in-out infinite;
}

@keyframes particle-stardust {
  0%   { transform: translateY(100vh) scale(0.3); opacity: 0; }
  20%  { opacity: 0.9; transform: translateY(75vh) scale(1.5); }
  40%  { opacity: 0.4; transform: translateY(55vh) scale(0.8); }
  60%  { opacity: 1;   transform: translateY(35vh) scale(1.8); }
  80%  { opacity: 0.3; transform: translateY(15vh) scale(0.6); }
  100% { transform: translateY(-5vh) scale(0.2); opacity: 0; }
}

/* Wisp — spiral rise + purple glow */
.particle-wisp {
  background: radial-gradient(circle, #c8a8f0 0%, #7a4aaa 50%, transparent 75%);
  width: 7px;
  height: 7px;
  box-shadow: 0 0 20px rgba(122,74,170,0.45), 0 0 40px rgba(122,74,170,0.15);
  animation: particle-wisp 7s ease-in-out infinite;
}

@keyframes particle-wisp {
  0%   { transform: translateY(90vh) translateX(0) rotate(0deg); opacity: 0; }
  15%  { opacity: 0.6; }
  33%  { transform: translateY(60vh) translateX(50px) rotate(120deg); opacity: 0.8; }
  50%  { transform: translateY(45vh) translateX(-30px) rotate(180deg); opacity: 0.5; }
  66%  { transform: translateY(28vh) translateX(40px) rotate(240deg); opacity: 0.7; }
  85%  { opacity: 0.3; }
  100% { transform: translateY(-5vh) translateX(-20px) rotate(360deg); opacity: 0; }
}

/* ============================================================
   5. Cinematic Exploration Overlay
   ============================================================ */
.explore-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: explore-fade-in 0.8s ease-out forwards;
}

@keyframes explore-fade-in {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

.explore-text {
  font-family: var(--font-chinese-display);
  font-size: 2.2rem;
  color: var(--text-on-dark);
  max-width: 600px;
  line-height: 2;
  text-align: center;
  padding: var(--space-md);
  text-shadow: 0 0 30px rgba(184,160,110,0.15);
}

.explore-text .explore-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: char-reveal 0.6s ease-out forwards;
}

@keyframes char-reveal {
  0%   { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   6. Riddle Phase
   ============================================================ */
.riddle-parchment {
  background: linear-gradient(160deg, #faf7f2 0%, #f0ead8 100%);
  border: 2px solid var(--accent-gold);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  max-width: 560px;
  width: 90%;
  box-shadow:
    0 10px 50px rgba(0,0,0,0.5),
    0 0 40px rgba(184,160,110,0.12),
    inset 0 1px 0 rgba(255,255,255,0.5);
  position: relative;
  z-index: 50;
  margin: var(--space-md);
}

.riddle-parchment::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: calc(var(--radius-md) + 2px);
  background: linear-gradient(135deg, var(--accent-gold), transparent 40%, transparent 60%, var(--accent-gold));
  z-index: -1;
  opacity: 0.3;
}

.riddle-text-zh {
  font-family: var(--font-chinese-display);
  font-size: 1.4rem;
  line-height: 2;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: var(--space-sm);
}

.riddle-text-zh .riddle-char {
  display: inline-block;
  opacity: 0;
  animation: riddle-char-glow 0.5s ease-out forwards;
}

@keyframes riddle-char-glow {
  0%   { opacity: 0; text-shadow: 0 0 0 transparent; }
  60%  { opacity: 1; text-shadow: 0 0 20px rgba(184,160,110,0.4); }
  100% { opacity: 1; text-shadow: 0 0 0 transparent; }
}

.riddle-text-en {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  margin-top: var(--space-sm);
  line-height: 1.6;
}

.silhouette-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  justify-content: center;
  margin-top: var(--space-xl);
}

.silhouette-card {
  width: 140px;
  height: 180px;
  background: #1a120a;
  border: 2px solid rgba(184,160,110,0.2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.silhouette-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(0deg, rgba(13,10,5,0.6) 0%, transparent 100%);
  pointer-events: none;
}

.silhouette-card:hover {
  transform: scale(1.08);
  border-color: var(--accent-gold);
  box-shadow: 0 0 20px rgba(184,160,110,0.3), 0 0 40px rgba(184,160,110,0.1);
}

.silhouette-card .silhouette-shape {
  width: 80%;
  height: 70%;
  opacity: 0.3;
  transition: opacity 0.3s;
  background: #2a2015;
}

.silhouette-card:hover .silhouette-shape {
  opacity: 0.5;
}

/* ============================================================
   7. Beast Revelation
   ============================================================ */
.reveal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 80;
  background: rgba(0,0,0,0.7);
  overflow: hidden;
}

.reveal-shockwave {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px;
  height: 100px;
  margin-left: -50px;
  margin-top: -50px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184,160,110,0.9) 0%, rgba(184,160,110,0.3) 40%, transparent 70%);
  animation: shockwave-burst 1s ease-out forwards;
  pointer-events: none;
}

@keyframes shockwave-burst {
  0%   { transform: scale(0); opacity: 1; }
  50%  { opacity: 0.8; }
  100% { transform: scale(4); opacity: 0; }
}

.reveal-smoke {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  margin-left: -100px;
  margin-top: -100px;
  background: radial-gradient(circle, rgba(20,15,10,0.9) 0%, rgba(30,25,20,0.4) 40%, transparent 70%);
  border-radius: 50%;
  animation: smoke-dissolve 1.2s ease-out forwards;
  pointer-events: none;
}

@keyframes smoke-dissolve {
  0%   { transform: scale(1); opacity: 0.8; }
  60%  { opacity: 0.4; }
  100% { transform: scale(2.5); opacity: 0; }
}

.reveal-beast {
  position: relative;
  z-index: 2;
  animation: beast-emerge 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
  transform: scale(0.3);
  max-width: 300px;
  max-height: 300px;
}

@keyframes beast-emerge {
  0%   { transform: scale(0.3); opacity: 0; }
  60%  { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.reveal-result {
  margin-top: var(--space-lg);
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--accent-gold);
  text-align: center;
  text-shadow: 0 0 20px rgba(184,160,110,0.3);
  position: relative;
  z-index: 2;
  padding: 0 var(--space-md);
}

.reveal-result.reveal-correct {
  animation: result-glow-pulse 2s ease-in-out infinite;
}

@keyframes result-glow-pulse {
  0%, 100% { text-shadow: 0 0 20px rgba(184,160,110,0.3); }
  50%      { text-shadow: 0 0 40px rgba(184,160,110,0.6), 0 0 80px rgba(184,160,110,0.2); }
}

/* ============================================================
   8. Beast Card
   ============================================================ */
.beast-card {
  max-width: 480px;
  width: 90%;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: scroll-unfurl 0.8s ease-out forwards;
  transform-origin: top center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  position: relative;
  z-index: 60;
}

@keyframes scroll-unfurl {
  0%   { transform: scaleY(0); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: scaleY(1); opacity: 1; }
}

/* Rarity Borders */
.beast-card.rarity-凡 {
  border: 2px solid #6b6b6b;
}

.beast-card.rarity-灵 {
  border: 2px solid rgba(100,180,220,0.4);
  box-shadow: 0 0 15px rgba(100,180,220,0.08);
}

.beast-card.rarity-仙 {
  border: 2px solid var(--accent-gold);
  box-shadow: 0 0 25px rgba(184,160,110,0.2), 0 0 50px rgba(184,160,110,0.08);
}

.beast-card.rarity-仙::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: calc(var(--radius-lg) + 2px);
  background: linear-gradient(135deg, transparent 0%, rgba(184,160,110,0.15) 50%, transparent 100%);
  z-index: -1;
  animation: foil-shimmer 3s ease-in-out infinite;
  background-size: 200% 200%;
}

.beast-card.rarity-神 {
  border: 2px solid var(--accent-gold);
  box-shadow: 0 0 30px rgba(184,160,110,0.25), 0 0 60px rgba(184,160,110,0.1);
}

.beast-card.rarity-神::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: calc(var(--radius-lg) + 2px);
  background: linear-gradient(
    135deg,
    transparent 0%,
    rgba(184,160,110,0.1) 15%,
    rgba(232,220,200,0.15) 30%,
    rgba(184,160,110,0.2) 45%,
    transparent 55%,
    rgba(184,160,110,0.1) 70%,
    rgba(232,220,200,0.15) 85%,
    transparent 100%
  );
  background-size: 300% 300%;
  z-index: -1;
  animation: foil-shimmer 2.5s ease-in-out infinite;
}

@keyframes foil-shimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.beast-illustration {
  height: 240px;
  background: #1a1510;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.1s ease-out;
}

.beast-illustration img,
.beast-illustration .beast-icon {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
}

.beast-card-body {
  padding: var(--space-lg);
}

.beast-name-zh {
  font-family: var(--font-chinese-display);
  font-size: 2rem;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 2px;
}

.beast-name-en {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
}

.beast-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.beast-tags .tag {
  font-family: var(--font-chinese);
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(0,0,0,0.1);
  background: rgba(184,160,110,0.08);
  color: var(--text-secondary);
}

.beast-tags .tag.rarity-tag {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background: rgba(184,160,110,0.12);
}

.beast-tags .tag.region-tag {
  border-color: var(--accent-stone);
  color: var(--accent-stone);
  background: rgba(61,122,140,0.08);
}

.beast-stats {
  margin-bottom: var(--space-md);
}

.stat-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 10px;
}

.stat-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  width: 80px;
  flex-shrink: 0;
}

.stat-bar {
  flex: 1;
  height: 8px;
  background: rgba(44,36,22,0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.stat-fill {
  height: 100%;
  border-radius: 4px;
  width: 0;
  animation: stat-fill 1.2s ease-out 0.3s forwards;
}

.stat-fill.power {
  background: linear-gradient(90deg, var(--accent-vermillion), #e06040);
}

.stat-fill.wisdom {
  background: linear-gradient(90deg, var(--accent-stone), #5a9aaa);
}

.stat-fill.mystery {
  background: linear-gradient(90deg, #7a4aaa, #a070d0);
}

.stat-fill.ferocity {
  background: linear-gradient(90deg, #8b2020, #cc3030);
}

.stat-fill.benevolence {
  background: linear-gradient(90deg, var(--accent-gold), #d4c080);
}

@keyframes stat-fill {
  0%   { width: 0; }
  100% { width: var(--stat-value, 0%); }
}

.beast-lore {
  background: linear-gradient(160deg, #f5f0e8 0%, #ece4d4 100%);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  max-height: 160px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.beast-lore::-webkit-scrollbar {
  width: 4px;
}

.beast-lore::-webkit-scrollbar-track {
  background: transparent;
}

.beast-lore::-webkit-scrollbar-thumb {
  background: var(--accent-gold);
  border-radius: 2px;
}

.beast-lore .lore-dropcap::first-letter {
  font-family: var(--font-display);
  font-size: 2.8rem;
  float: left;
  line-height: 1;
  margin-right: 8px;
  color: var(--accent-gold);
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.beast-lore .lore-zh {
  font-family: var(--font-chinese);
  margin-bottom: var(--space-xs);
}

.beast-lore .lore-en {
  font-family: var(--font-body);
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ============================================================
   9. Bestiary Gallery Drawer
   ============================================================ */
.gallery-drawer {
  position: fixed;
  right: -500px;
  top: 52px;
  height: calc(100vh - 52px);
  width: 500px;
  background: #1f1810;
  z-index: 300;
  transition: right 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
  border-left: 1px solid rgba(184,160,110,0.15);
  box-shadow: -5px 0 30px rgba(0,0,0,0.4);
}

.gallery-drawer.open {
  right: 0;
}

.gallery-drawer::-webkit-scrollbar {
  width: 4px;
}

.gallery-drawer::-webkit-scrollbar-track {
  background: transparent;
}

.gallery-drawer::-webkit-scrollbar-thumb {
  background: rgba(184,160,110,0.3);
  border-radius: 2px;
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid rgba(232,220,200,0.08);
  position: sticky;
  top: 0;
  background: #1f1810;
  z-index: 2;
}

.gallery-header h2 {
  font-family: var(--font-chinese-display);
  font-size: 1.4rem;
  color: var(--text-on-dark);
  letter-spacing: 0.1em;
}

.gallery-header .gallery-close {
  background: none;
  border: 1px solid rgba(232,220,200,0.2);
  color: var(--text-on-dark);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.gallery-header .gallery-close:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background: rgba(184,160,110,0.1);
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid rgba(232,220,200,0.06);
}

.gallery-filters .filter-pill {
  font-family: var(--font-chinese);
  font-size: 0.78rem;
  padding: 4px 14px;
  border-radius: 16px;
  border: 1px solid rgba(232,220,200,0.15);
  background: transparent;
  color: rgba(232,220,200,0.6);
  cursor: pointer;
  transition: all 0.3s;
}

.gallery-filters .filter-pill:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.gallery-filters .filter-pill.active {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: #111;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  padding: var(--space-md);
}

.gallery-slot {
  height: 160px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-slot.collected {
  background: rgba(250,247,242,0.06);
  border: 1px solid rgba(184,160,110,0.2);
  cursor: pointer;
}

.gallery-slot.collected:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.gallery-slot.collected .slot-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: var(--space-xs);
  text-align: center;
}

.gallery-slot.collected .slot-icon {
  font-size: 2rem;
  margin-bottom: 4px;
  filter: grayscale(0.2);
}

.gallery-slot.collected .slot-name {
  font-family: var(--font-chinese);
  font-size: 0.78rem;
  color: var(--text-on-dark);
}

.gallery-slot.uncollected {
  background: rgba(26,18,10,0.5);
  border: 1px solid rgba(232,220,200,0.06);
}

.gallery-slot.uncollected .pedestal-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.gallery-slot.uncollected .pedestal-empty::before {
  content: '?';
  font-family: var(--font-display);
  font-size: 2rem;
  color: rgba(184,160,110,0.15);
}

.gallery-slot.uncollected .pedestal-smoke {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  animation: pedestal-smoke 4s linear infinite;
  pointer-events: none;
}

@keyframes pedestal-smoke {
  0%   { background: radial-gradient(ellipse 20% 8% at 30% 80%, rgba(122,74,170,0.08) 0%, transparent 100%); }
  25%  { background: radial-gradient(ellipse 20% 8% at 70% 80%, rgba(122,74,170,0.06) 0%, transparent 100%); }
  50%  { background: radial-gradient(ellipse 20% 8% at 60% 70%, rgba(180,160,200,0.07) 0%, transparent 100%); }
  75%  { background: radial-gradient(ellipse 20% 8% at 40% 85%, rgba(122,74,170,0.06) 0%, transparent 100%); }
  100% { background: radial-gradient(ellipse 20% 8% at 30% 80%, rgba(122,74,170,0.08) 0%, transparent 100%); }
}

/* Rarity glow on collected gallery slots */
.gallery-slot.rarity-灵.collected {
  box-shadow: inset 0 0 12px rgba(100,180,220,0.08);
}

.gallery-slot.rarity-仙.collected {
  box-shadow: inset 0 0 15px rgba(184,160,110,0.12);
  border-color: rgba(184,160,110,0.35);
}

.gallery-slot.rarity-神.collected {
  box-shadow: inset 0 0 20px rgba(184,160,110,0.15);
  border-color: rgba(184,160,110,0.45);
}

/* ============================================================
   10. Locked State
   ============================================================ */
.phase-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: var(--space-xl) var(--space-md);
}

.phase-locked .lock-icon {
  font-size: 4rem;
  color: var(--accent-gold);
  opacity: 0.5;
  margin-bottom: var(--space-md);
  animation: lock-pulse 3s ease-in-out infinite;
}

@keyframes lock-pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50%      { transform: scale(1.08); opacity: 0.7; }
}

.phase-locked .lock-message {
  font-family: var(--font-chinese-display);
  font-size: 1.6rem;
  color: var(--text-on-dark);
  margin-bottom: var(--space-sm);
}

.phase-locked .lock-sub {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  max-width: 400px;
}

.phase-locked .countdown-timer {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--accent-gold);
  text-shadow: 0 0 20px rgba(184,160,110,0.2);
  margin-bottom: var(--space-lg);
}

.phase-locked .btn-bestiary-locked {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-on-dark);
  border: 1px solid rgba(232,220,200,0.2);
  padding: 10px 28px;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s;
}

.phase-locked .btn-bestiary-locked:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background: rgba(184,160,110,0.08);
}

/* ============================================================
   11. Milestone Celebrations
   ============================================================ */

/* 25% — subtle gold glow on map border */
.celebration-25-active .map-container {
  box-shadow: 0 0 30px rgba(184,160,110,0.15);
  transition: box-shadow 1s ease;
}

@keyframes celebration-25 {
  0%   { box-shadow: 0 0 0 rgba(184,160,110,0); }
  50%  { box-shadow: 0 0 60px rgba(184,160,110,0.2); }
  100% { box-shadow: 0 0 30px rgba(184,160,110,0.1); }
}

/* 50% — gold particles rain across screen */
.celebration-50-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 200;
  overflow: hidden;
}

.celebration-50-overlay .gold-rain {
  position: absolute;
  top: -10px;
  width: 4px;
  height: 20px;
  background: linear-gradient(0deg, transparent, var(--accent-gold));
  animation: celebration-50 var(--rain-duration, 2s) linear infinite;
  opacity: 0;
}

@keyframes celebration-50 {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 0; }
  20%  { opacity: 0.8; }
  80%  { opacity: 0.4; }
  100% { transform: translateY(110vh) rotate(180deg); opacity: 0; }
}

/* 75% — banner slides down from top */
.celebration-75-banner {
  position: fixed;
  top: 52px;
  left: 0;
  width: 100%;
  background: linear-gradient(180deg, rgba(184,160,110,0.15) 0%, transparent 100%);
  text-align: center;
  padding: var(--space-md) var(--space-sm) var(--space-xl);
  z-index: 150;
  transform: translateY(-100%);
  animation: celebration-75 1.5s ease-out 0.3s forwards;
  pointer-events: none;
}

.celebration-75-banner h3 {
  font-family: var(--font-chinese-display);
  font-size: 2rem;
  color: var(--accent-gold);
  text-shadow: 0 0 30px rgba(184,160,110,0.3);
}

@keyframes celebration-75 {
  0%   { transform: translateY(-100%); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

/* 100% — full-screen gold sparkle shower + Master of Beasts title */
.celebration-100-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle, rgba(13,10,5,0.6) 0%, rgba(13,10,5,0.9) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 400;
  animation: celebration-100-fade 1s ease-out forwards;
  pointer-events: none;
}

.celebration-100-overlay .master-title {
  font-family: var(--font-chinese-display);
  font-size: 3.5rem;
  color: var(--accent-gold);
  text-shadow: 0 0 40px rgba(184,160,110,0.4), 0 0 80px rgba(184,160,110,0.15);
  animation: master-title-appear 1.5s ease-out 0.5s forwards;
  opacity: 0;
  transform: scale(0.5);
}

.celebration-100-overlay .master-subtitle {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-on-dark);
  margin-top: var(--space-sm);
  opacity: 0;
  animation: master-title-appear 1s ease-out 1.2s forwards;
}

@keyframes celebration-100-fade {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes master-title-appear {
  0%   { opacity: 0; transform: scale(0.5); }
  70%  { opacity: 1; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

.celebration-100-overlay .sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--accent-gold);
  border-radius: 50%;
  animation: sparkle-shower var(--sparkle-dur, 3s) ease-out infinite;
}

@keyframes sparkle-shower {
  0%   { transform: translateY(-10vh) scale(0); opacity: 0; }
  20%  { opacity: 1; }
  50%  { transform: translateY(50vh) scale(1.5); opacity: 0.8; }
  80%  { opacity: 0.3; }
  100% { transform: translateY(110vh) scale(0); opacity: 0; }
}

/* ============================================================
   12. Buttons
   ============================================================ */
.btn-gallery {
  font-family: var(--font-display);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #111;
  background: var(--accent-gold);
  border: none;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 12px rgba(184,160,110,0.2);
}

.btn-gallery:hover {
  background: #d4b878;
  box-shadow: 0 4px 20px rgba(184,160,110,0.35);
  transform: translateY(-1px);
}

.btn-gallery:active {
  transform: translateY(0);
}

.btn-share {
  font-family: var(--font-display);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-on-dark);
  background: transparent;
  border: 1px solid rgba(232,220,200,0.2);
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s;
}

.btn-share:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background: rgba(184,160,110,0.08);
}

.btn-continue {
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #111;
  background: var(--accent-gold);
  border: none;
  padding: 12px 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 12px rgba(184,160,110,0.2);
}

.btn-continue:hover {
  background: #d4b878;
  box-shadow: 0 4px 24px rgba(184,160,110,0.4);
  transform: translateY(-1px);
}

.btn-continue:active {
  transform: translateY(0);
}

/* ============================================================
   13. Responsive — Tablet
   ============================================================ */
@media (max-width: 1024px) {
  .region-hotspot {
    width: 56px;
    height: 56px;
  }

  .map-header h1 {
    font-size: 2.4rem;
  }

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

  .gallery-drawer {
    width: 400px;
    right: -400px;
  }

  .silhouette-card {
    width: 120px;
    height: 155px;
  }

  .silhouette-row {
    gap: var(--space-md);
  }

  .celebration-100-overlay .master-title {
    font-size: 2.6rem;
  }
}

/* ============================================================
   13. Responsive — Mobile
   ============================================================ */
@media (max-width: 767px) {
  .map-container {
    position: relative;
    height: 60vh;
    min-height: 400px;
  }

  .map-header h1 {
    font-size: 1.8rem;
  }

  .map-header .map-subtitle {
    font-size: 0.7rem;
  }

  .region-hotspot {
    width: 60px;
    height: 60px;
  }

  .bestiary-phase.active {
    flex-direction: column;
  }

  .gallery-drawer {
    width: 100vw;
    right: -100vw;
    top: 52px;
    height: calc(100vh - 52px);
  }

  .gallery-drawer.open {
    right: 0;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: var(--space-sm);
  }

  .gallery-slot {
    height: 130px;
  }

  .riddle-parchment {
    padding: var(--space-md);
    max-width: 100%;
    margin: var(--space-sm);
    border-radius: var(--radius-sm);
  }

  .riddle-text-zh {
    font-size: 1.1rem;
  }

  .silhouette-card {
    width: 100px;
    height: 130px;
  }

  .silhouette-row {
    gap: var(--space-sm);
  }

  .reveal-result {
    font-size: 1.2rem;
  }

  .beast-card {
    width: 95%;
    border-radius: var(--radius-md);
  }

  .beast-illustration {
    height: 180px;
  }

  .beast-name-zh {
    font-size: 1.6rem;
  }

  .beast-card-body {
    padding: var(--space-md);
  }

  .stat-label {
    width: 60px;
    font-size: 0.65rem;
  }

  .celebration-100-overlay .master-title {
    font-size: 2rem;
  }

  .celebration-75-banner h3 {
    font-size: 1.4rem;
  }
}

/* ============================================================
   14. Bestiary Overlay (Particle Container)
   ============================================================ */
.bestiary-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 250;
  pointer-events: none;
  overflow: hidden;
}
