/* --- 1. 字体与全局样式 --- */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&display=swap');

:root {
  --fantasy-font: 'Cinzel', serif;
  --main-font: "Microsoft Yahei", Arial, sans-serif;
  --primary-red: #a32a2a;
  --dark-red: #7a1f1f;
  --gold-light: #ffea70;
  --gold-dark: #ffc940;
  --parchment-light: #fff9e6;
  --parchment-dark: #f5e4c3;
  --text-color: #4a2525;
}

body {
  margin: 0;
  font-family: var(--main-font);
  background: url("background.jpg") no-repeat center center fixed;
  background-size: cover;
  color: var(--text-color);
  transition: background-image 0.5s ease-in-out;
}


/* --- 3. 标题与头部 --- */
header { display: flex; justify-content: flex-end; padding: 20px; }
h1 {
  font-family: var(--fantasy-font);
  font-size: 52px;
  color: var(--primary-red);
  text-shadow: 1px 1px 0px #fff, 2px 2px 5px var(--gold-light);
  margin-bottom: 10px;
}

main { text-align: center; padding: 20px; }

/* --- 4. 核心元素：卡片 (Cards) --- */
.cards { display: flex; justify-content: center; gap: 40px; margin-top: 40px; flex-wrap: wrap; }
.card {
  width: 300px;
  height: 450px;
  border: none;
  border-radius: 12px;
  box-shadow: 
    inset 0 0 20px rgba(122, 31, 31, 0.2),
    0 0 0 3px var(--dark-red),
    0 0 0 6px var(--gold-dark),
    8px 8px 15px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  
  /* [!!!] 修正：直接在这里添加背景 */
  background-color: var(--parchment-light);
  background-image: 
    linear-gradient(to bottom, rgba(255, 249, 230, 0.9), rgba(245, 228, 195, 0.9)),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 
    inset 0 0 25px rgba(122, 31, 31, 0.3),
    0 0 0 3px var(--dark-red),
    0 0 0 6px var(--gold-light),
    12px 12px 20px rgba(0,0,0,0.4);
}

.card img {
  width: 90%;
  height: auto;
  border: 3px solid var(--dark-red);
  border-radius: 10px;
  margin-top: 10px;
  flex-grow: 1;
  object-fit: cover;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.4);
}

/* --- 5. 通用按钮 (Buttons) 与 UI 面板 --- */
.connect-btn, .claim-btn, .claim-expedition-btn, .mint-btn, .attack-btn {
  padding: 12px 24px;
  background: linear-gradient(to bottom, var(--gold-light), var(--gold-dark));
  border: 2px solid var(--dark-red);
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--fantasy-font);
  font-weight: 700;
  font-size: 16px;
  color: var(--dark-red);
  text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.5);
  box-shadow: 
    inset 0 2px 2px rgba(255, 255, 255, 0.7),
    0 4px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  margin-top: 10px;
}
.connect-btn { padding: 10px 20px; font-size: 14px; }
.mint-btn, .attack-btn { padding: 10px 20px; margin-top: 5px; }

.connect-btn:hover, .claim-btn:hover, .claim-expedition-btn:hover, .mint-btn:hover, .attack-btn:hover {
  background: linear-gradient(to bottom, #fff5a3, #ffdd70);
  box-shadow: 
    inset 0 2px 2px rgba(255, 255, 255, 0.8),
    0 6px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}
.connect-btn:active, .claim-btn:active, .claim-expedition-btn:active, .mint-btn:active, .attack-btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.3);
}

.mint-btn:disabled, .claim-btn:disabled, .attack-btn:disabled, .claim-expedition-btn:disabled {
  background: #a9a9a9;
  border-color: #666;
  color: #444;
  cursor: not-allowed;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.3);
  transform: translateY(1px);
}

/* --- 6. 状态面板 (Rewards, Owned, Timer) --- */
#status-panel { min-height: 100px; }
.rewards, .owned, .countdown-timer {
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  box-shadow: 
    inset 0 0 10px rgba(0,0,0,0.1),
    0 0 0 2px var(--dark-red);
  display: inline-block;
  font-family: var(--fantasy-font);
  font-weight: 700;

  /* [!!!] 修正：直接在这里添加背景 */
  background-color: var(--parchment-light);
  background-image: 
    linear-gradient(to bottom, rgba(255, 249, 230, 0.9), rgba(245, 228, 195, 0.9)),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.rewards { font-size: 24px; margin: 20px 0 10px 0; }
.owned { margin: 10px 0; font-size: 18px; padding: 6px 12px; }
.countdown-timer {
  font-size: 36px;
  color: var(--primary-red);
  margin: 20px 0 10px 0;
  padding: 15px;
  text-shadow: 1px 1px 2px var(--gold-light);
}

/* --- 7. 场景切换面板 --- */
.switch-panel {
  position: fixed;
  left: 10px;
  bottom: -80px; /* 因为有4个按钮，稍微上调一点 */

  width: 480px; 
  aspect-ratio: 400 / 330; 

  background: url("Switch.png") no-repeat center center;
  background-size: contain;
  
  /* 调整内边距以适应4个按钮 */
  padding: 60px 50px;
  
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 22px; 
  
  box-shadow: none;
  filter: none;
}

/* 针对所有按钮的通用样式 (也是前面两个按钮的最终样式) */
.switch-panel button {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  font-family: var(--fantasy-font);
  font-weight: 700;
  transform: none;
  transition: all 0.3s ease;

  /* “Castle” 和 “Dungeon” 的样式 */
  font-size: 36px;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8); /* 加深阴影让白字更突出 */
}

/* 专门针对 "coming-soon" class 按钮的覆盖样式 */
.switch-panel .coming-soon {
  /* “Blacksmithy” 和 “Arena” 的样式 */
  font-size: 24px; /* 更小的字体 */
  color: #2a1a0e; /* 深棕色，像褪色的文字 */
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3); /* 轻微的亮色阴影 */
  pointer-events: none; /* 禁用鼠标交互 */
  cursor: default;
}

/* 只有非 "coming-soon" 的按钮才有悬停效果 */
.switch-panel button:not(.coming-soon):hover {
  color: #fff5d1; /* 悬停时变为淡金色 */
  cursor: pointer;
}

.hidden { display: none; }