/* ===== 全局 ===== */
body, html {
  margin: 0;
  padding: 0;
  font-family: 'Noto Sans JP', sans-serif;
  height: 100%;
  overflow-x: hidden;
  background: linear-gradient(135deg, #f3ecff 0%, #d4f1ff 100%); /* 浅粉 → 浅蓝渐变 */
}

section { position: relative; z-index: 1; }

/* ===== 导航栏 ===== */
.navbar {
  margin-top: 0px; height: 60px;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 40px;
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 6px rgba(255,192,203,0.3);
  position: sticky; top: 0px;
}
.navbar .logo { font-size: 20px; font-weight: bold; color: #ff69b4; }
.navbar ul { display: flex; list-style: none; gap: 40px; }
.navbar a { text-decoration: none; color: #555; font-weight: 500; transition: 0.3s; }
.navbar a:hover { color: #ff69b4; text-shadow: 0 0 4px rgba(255,182,193,0.8); }

/* ===== 夜间模式按钮 ===== */
.theme-toggle {
  padding: 8px 16px; border: 2px solid #ff69b4;
  border-radius: 12px; background: transparent;
  color: #ff69b4; cursor: pointer; transition: 0.3s;
}
.theme-toggle:hover { background: #ff69b4; color: #fff; transform: scale(1.08); }

/* ===== 主视觉区 ===== */
.hero {
  height: 70vh; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center;
  background: linear-gradient;
  transition: background 0.6s ease;
  position: relative; overflow: hidden;
}

/* style.css：添加 —— 隐藏主视觉图时整体收缩 hero 的规则 */
.hero.no-image {
  min-height: 0 !important;
  padding-top: 12px;
  padding-bottom: 12px;
  gap: 12px;
}
.hero.no-image .hero-image { display: none !important; }

.hero-content h1 { font-size: 42px; color: #ff69b4; text-shadow: 1px 1px 2px rgba(255,182,193,0.8); }
.hero-content p { font-size: 18px; color: #666; }
.hero-btn {
  margin-top: 20px; padding: 10px 30px;
  border: none; border-radius: 20px;
  background: linear-gradient(90deg, #ffb6c1, #ff8fc0);
  color: #fff; font-weight: bold; cursor: pointer; transition: 0.3s;
}
.hero-btn:hover { transform: scale(1.05); background: linear-gradient(90deg, #ff8fc0, #ff69b4); }

/* ===== 内容区 ===== */
.content {
  max-width: 800px; margin: 60px auto;
  padding: 20px; background: rgba(255,255,255,0.6);
  border-radius: 20px; box-shadow: 0 4px 12px rgba(255,182,193,0.3);
  backdrop-filter: blur(8px); text-align: center;
}
/* 🍓 关于本站 特效文字 */
.art-text span {
  color: #ff69b4;
  text-shadow: 0 0 8px rgba(255,192,203,0.7), 0 0 12px rgba(255,105,180,0.5);
  font-weight: bold;
  transition: color 0.5s, text-shadow 0.5s;
}
body.dark .art-text span {
  color: #d59cff;
  text-shadow: 0 0 10px rgba(180,140,255,0.7), 0 0 16px rgba(150,120,255,0.6);
}

/* ===== 游戏区域 ===== */
.game-config, .game-result {
  max-width: 800px; margin: 60px auto; padding: 20px;
  background: rgba(255,255,255,0.6); border-radius: 16px;
  box-shadow: 0 4px 12px rgba(255,182,193,0.3); backdrop-filter: blur(8px);
  text-align: center;
}
.game-config h2, .game-result h3 { color: #ff69b4; text-shadow: 1px 1px 2px rgba(255,182,193,0.8); }
.game-desc { color: #666; margin-bottom: 15px; }
.game-control { display: flex; justify-content: space-between; align-items: center; }
#startGameBtn, #playAgain,#startExploreBtn {
  padding: 10px 20px; border: none; border-radius: 12px;
  background: linear-gradient(90deg, #ffb6c1, #ff8fc0);
  color: #fff; font-weight: bold; cursor: pointer; transition: 0.3s;
}
#startGameBtn:hover, #playAgain:hover，#startExploreBtn { transform: scale(1.05); background: linear-gradient(90deg, #ff8fc0, #ff69b4); }
.theme-select { display: flex; align-items: center; gap: 10px; }
#themeSelect { padding: 8px 12px; border-radius: 10px; border: 1px solid #ffb6c1; }

/* 游戏卡牌 */
.game-area { display: flex; justify-content: center; align-items: center; flex-direction: column; }
.game-board {
  display: grid;
  grid-template-columns: repeat(5, 120px);
  grid-template-rows: repeat(2, 160px);
  gap: 16px;
  perspective: 1000px;
}
.card {
  width: 120px; height: 160px; position: relative;
  transform-style: preserve-3d; transition: transform 0.6s;
  cursor: pointer;
}
.card.flip { transform: rotateY(180deg); }
.card .front, .card .back {
  position: absolute; width: 100%; height: 100%;
  border-radius: 12px; backface-visibility: hidden;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}
.card .front {
  transform: rotateY(180deg);
  background-size: cover;
  background-position: center;
}
.card .back {
  background: linear-gradient(135deg, #ffb6c1, #ff69b4);
  display: flex; justify-content: center; align-items: center;
  font-size: 20px; color: white; font-weight: bold;
  transition: box-shadow 0.6s;
}

/* 夜间模式卡牌背面发光动画 */
body.dark .card .back {
  background: linear-gradient(135deg, #8c6aff, #b27cff);
  animation: glowPulse 2.5s infinite ease-in-out;
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(180,140,255,0.6), 0 0 20px rgba(140,100,255,0.4); }
  50% { box-shadow: 0 0 25px rgba(190,160,255,0.8), 0 0 45px rgba(170,130,255,0.6); }
}

/* ===== 页脚 ===== */
.footer {
  margin-top: 80px;
  text-align: center;
  padding: 30px;
}
.footer p {
  color: #ff69b4;
  font-weight: bold;
  font-size: 16px;
}
body.dark .footer p {
  color: #d59cff;
}

/* 夜间模式 */
body.dark {
  background: linear-gradient(180deg, #1e1e2e 0%, #2a2038 100%);
  color: #e8e8f8;
}
body.dark .hero { background: linear-gradient(180deg, #2a2038 0%, #1a1025 100%); }
body.dark .hero-content h1 { color: #d59cff; }
body.dark .content, body.dark .game-config, body.dark .game-result {
  background: rgba(60,50,80,0.5);
  color: #e8e8f8;
}
/* ====== 新增样式（星空与层级调整） ====== */

/* 调整导航栏层级，仅次于顶部信息 */
.navbar {
  z-index: 999;
}

/* 星空画布层 */
#starCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background: transparent;
}

/* ====== 新增：扫雷 Minesweeper 样式 ====== */

.minesweeper {
  max-width: 800px;
  margin: 60px auto;
  padding: 20px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(255, 182, 193, 0.3);
  backdrop-filter: blur(8px);
  text-align: center;
}

/* ===== 💣 Minesweeper 动态展开/收起 ===== */

/* 初始隐藏棋盘（未开始） */
.minesweeper .mine-board {
  max-height: 0;
  opacity: 0;
  transform: scale(0.98);
  transition: max-height 0.8s ease, opacity 0.6s ease, transform 0.6s ease;
  margin-top: 0;
  pointer-events: none;
}

/* 游戏开始时（添加 .playing 类）展开显示 */
.minesweeper.playing .mine-board {
  max-height: 700px; /* 足够容纳 16×16 */
  opacity: 1;
  transform: scale(1);
  margin-top: 20px;
  pointer-events: auto;
}

/* ✅ 保留光影溢出可见 */
.minesweeper {
  overflow: visible;
}

.minesweeper h2 {
  color: #ff69b4;
  text-shadow: 1px 1px 2px rgba(255,182,193,0.8);
}

.difficulty-select {
  display: flex;
  align-items: center;
  gap: 10px;
}

#difficultySelect {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #ffb6c1;
}

.mine-board {
  display: inline-grid;
  margin-top: 20px;
  background: rgba(255,255,255,0.5);
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(255,182,193,0.3);
  overflow: hidden;
}

.mine-cell {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,182,193,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  color: #ff69b4;
  background: linear-gradient(180deg, #fff0f7, #ffeaf5);
  transition: background 0.3s, transform 0.1s;
}

.mine-cell:hover {
  transform: scale(1.05);
  background: #ffedf3;
}

.mine-cell.revealed {
  background: #fff;
  color: #444;
  cursor: default;
}

.mine-cell.bomb {
  background: #ff8fc0;
  color: white;
}

.mine-cell.flagged {
  background: #ffd6e7;
  color: #ff69b4;
}

.mine-restart {
  margin-top: 20px;
}

#restartMine {
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(90deg, #ffb6c1, #ff8fc0);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}
#restartMine:hover {
  transform: scale(1.05);
  background: linear-gradient(90deg, #ff8fc0, #ff69b4);
}

/* ===== 新增：扫雷区域样式 ===== */

/* 让 Minesweeper 区域跟随主题变化 */
body.dark .minesweeper {
  background: rgba(60, 50, 80, 0.5);
  color: #e8e8f8;
  box-shadow: 0 4px 12px rgba(180,140,255,0.3);
}

/* “开始游戏”按钮样式与 Match Game 一致 */
.mine-start-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(90deg, #ffb6c1, #ff8fc0);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.mine-start-btn:hover {
  transform: scale(1.05);
  background: linear-gradient(90deg, #ff8fc0, #ff69b4);
}

/* 夜间模式下按钮色调 */
body.dark .mine-start-btn {
  background: linear-gradient(90deg, #8c6aff, #b27cff);
  color: #fff;
}

body.dark .mine-start-btn:hover {
  background: linear-gradient(90deg, #b27cff, #8c6aff);
  transform: scale(1.05);
}

/* ===== 新增：开始游戏按钮发光点击动画 ===== */

/* 定义发光动画关键帧 */
@keyframes buttonGlow {
  0% {
    box-shadow: 0 0 0 rgba(255,182,193,0);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 25px rgba(255,182,193,0.6), 0 0 50px rgba(255,105,180,0.4);
    transform: scale(1.08);
  }
  100% {
    box-shadow: 0 0 0 rgba(255,182,193,0);
    transform: scale(1);
  }
}

/* 点击时触发发光动画 */
#startGameBtn:active,
.mine-start-btn:active {
  animation: buttonGlow 0.8s ease-out;
}

/* 夜间模式下发光变为紫光 */
body.dark #startGameBtn:active,
body.dark .mine-start-btn:active {
  animation: buttonGlowDark 0.8s ease-out;
}

/* 夜间模式发光动画 */
@keyframes buttonGlowDark {
  0% {
    box-shadow: 0 0 0 rgba(180,140,255,0);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 25px rgba(180,140,255,0.6), 0 0 45px rgba(150,120,255,0.5);
    transform: scale(1.08);
  }
  100% {
    box-shadow: 0 0 0 rgba(180,140,255,0);
    transform: scale(1);
  }
}

/* ====== 新增：统一“开始游戏”按钮与主题联动、夜间荧光效果 ====== */

/* 让两个开始按钮统一为渐变按钮风格 */
#startGameBtn,
.mine-start-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(90deg, #ffb6c1, #ff8fc0);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

/* hover 效果（亮粉色渐变） */
#startGameBtn:hover,
.mine-start-btn:hover {
  transform: scale(1.05);
  background: linear-gradient(90deg, #ff8fc0, #ff69b4);
}

/* 夜间模式下的颜色变化（统一紫色系） */
body.dark #startGameBtn,
body.dark .mine-start-btn {
  background: linear-gradient(90deg, #8c6aff, #b27cff);
  color: #fff;
}

/* 夜间 hover 亮度增强 */
body.dark #startGameBtn:hover,
body.dark .mine-start-btn:hover {
  background: linear-gradient(90deg, #b27cff, #8c6aff);
}

/* 夜间模式下按钮添加微弱荧光 */
body.dark #startGameBtn,
body.dark .mine-start-btn {
  box-shadow: 0 0 8px rgba(180,140,255,0.5), 0 0 12px rgba(150,120,255,0.4);
}

/* 点击发光动画（沿用前面定义） */
#startGameBtn:active,
.mine-start-btn:active {
  animation: buttonGlow 0.8s ease-out;
}
body.dark #startGameBtn:active,
body.dark .mine-start-btn:active {
  animation: buttonGlowDark 0.8s ease-out;
}

/* ====== 新增：扫雷区域格子渐变色 ====== */

/* 扫雷格子默认（未翻开）渐变背景 */
.mine-cell {
  background: linear-gradient(180deg, #fff0f7 0%, #ffeaf5 100%);
  border: 1px solid rgba(255,182,193,0.4);
  transition: background 0.4s ease, transform 0.1s;
}

/* 未翻开的格子 hover 提亮 */
.mine-cell:hover {
  background: linear-gradient(180deg, #ffe0f0, #ffd6eb);
}
body.dark .mine-cell:hover {
  background: linear-gradient(180deg,  #ffe0f0, #ffd6eb);
}

/* 夜间模式下格子轻微荧光边缘 */
body.dark .mine-cell {
  box-shadow: 0 0 4px rgba(180,140,255,0.2);
}

/* ===== 新增：扫雷胜利 / 失败 动画特效 ===== */

/* 光波扩散效果（胜利） */
@keyframes boardWave {
  0% {
    box-shadow: 0 0 0 0 rgba(255,182,193,0.6);
  }
  70% {
    box-shadow: 0 0 30px 20px rgba(255,182,193,0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255,182,193,0);
  }
}

/* 夜间模式光波：淡紫粉色 */
@keyframes boardWaveDark {
  0% {
    box-shadow: 0 0 0 0 rgba(180,140,255,0.6);
  }
  70% {
    box-shadow: 0 0 30px 20px rgba(180,140,255,0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(180,140,255,0);
  }
}

/* 失败闪烁效果 */
@keyframes boardFail {
  0%, 100% {
    box-shadow: 0 0 0 rgba(255,0,0,0);
  }
  25%, 75% {
    box-shadow: 0 0 20px rgba(255,80,100,0.6);
  }
}

/* 夜间模式失败闪烁偏暗红 */
@keyframes boardFailDark {
  0%, 100% {
    box-shadow: 0 0 0 rgba(255,0,0,0);
  }
  25%, 75% {
    box-shadow: 0 0 20px rgba(200,70,100,0.5);
  }
}

/* 触发类名 */
.mine-board.wave {
  animation: boardWave 1s ease-out;
}
body.dark .mine-board.wave {
  animation: boardWaveDark 1s ease-out;
}

.mine-board.fail {
  animation: boardFail 0.8s ease-in-out;
}
body.dark .mine-board.fail {
  animation: boardFailDark 0.8s ease-in-out;
}

/* ===== 升级版：扫雷胜利环形光波动画 ===== */

/* 胜利环形渐变光波动画 */
@keyframes ringWave {
  0% {
    background: radial-gradient(circle at center, rgba(255,182,193,0.6) 0%, rgba(255,182,193,0) 60%);
    opacity: 1;
  }
  60% {
    background: radial-gradient(circle at center, rgba(255,182,193,0.4) 20%, rgba(255,182,193,0) 80%);
    opacity: 0.8;
    transform: scale(1.15);
  }
  100% {
    background: radial-gradient(circle at center, rgba(255,182,193,0) 100%);
    opacity: 0;
    transform: scale(1.3);
  }
}

/* 夜间粉紫光圈动画 */
@keyframes ringWaveDark {
  0% {
    background: radial-gradient(circle at center, rgba(180,140,255,0.5) 0%, rgba(180,140,255,0) 60%);
    opacity: 1;
  }
  60% {
    background: radial-gradient(circle at center, rgba(180,140,255,0.4) 20%, rgba(180,140,255,0) 80%);
    opacity: 0.8;
    transform: scale(1.15);
  }
  100% {
    background: radial-gradient(circle at center, rgba(180,140,255,0) 100%);
    opacity: 0;
    transform: scale(1.3);
  }
}

/* 光圈动画容器类 */
.mine-board.ring-wave::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%) scale(1);
  border-radius: 50%;
  pointer-events: none;
  animation: ringWave 1.2s ease-out forwards;
  z-index: 1;
  filter: blur(6px);
}

body.dark .mine-board.ring-wave::after {
  animation: ringWaveDark 1.2s ease-out forwards;
  filter: blur(8px);
}

/* 保持棋盘布局时的定位上下文 */
.mine-board {
  position: relative;
  overflow: hidden;
}

/* ===== 新增：BanG Dream! Match Game 区域显示控制 ===== */

/* 初始隐藏（未开始前不占空间） */
.game-area {
  display: none;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* 显示状态 */
.game-area.show {
  display: flex;
  opacity: 1;
  transform: scale(1);
}

/* ===== 设置下拉栏样式 ===== */
.nav-item.dropdown {
  position: relative;
}
.nav-item .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(255,182,193,0.3);
  min-width: 140px;
  padding: 8px 0;
  transition: all 0.3s ease;
  z-index: 100;
}
.nav-item:hover .dropdown-menu {
  display: block;
}
.nav-item .dropdown-menu a {
  display: block;
  padding: 8px 14px;
  text-decoration: none;
  color: #ff69b4;
  transition: background 0.3s ease;
}
.nav-item .dropdown-menu a:hover {
  background: rgba(255,182,193,0.2);
}

/* ===== 背景音乐面板样式 ===== */
.music-panel {
  position: fixed;
  top: 100px;
  right: -320px;
  width: 280px;
  background: rgba(255,255,255,0.85);
  border-radius: 16px 0 0 16px;
  box-shadow: -2px 4px 10px rgba(255,182,193,0.3);
  padding: 15px 20px;
  font-size: 15px;
  transition: all 0.5s ease;
  opacity: 0;
  transform: translate(20px, -10px);
  animation: none;
  z-index: 99;
  backdrop-filter: blur(10px);
}
.music-panel.show {
  right: 0;
  opacity: 1;
  animation: slideInPanel 0.4s ease-out;
  transform: translate(0, 0);
}

.music-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

/* 开关样式 */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  background: #ccc;
  border-radius: 24px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: .3s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #ff69b4;
}
input:checked + .slider:before {
  transform: translateX(22px);
}

/* 音量条样式 */
#volumeSlider {
  flex: 1;
  margin: 0 10px;
  cursor: pointer;
}
#volumeValue {
  min-width: 30px;
  text-align: right;
  color: #ff69b4;
}

/* 夜间模式适配 */
body.dark .music-panel {
  background: rgba(40,30,60,0.8);
  box-shadow: -2px 4px 10px rgba(180,140,255,0.3);
  color: #e8e8f8;
}
body.dark .nav-item .dropdown-menu {
  background: rgba(60,50,80,0.9);
}
body.dark .nav-item .dropdown-menu a {
  color: #b7a5ff;
}
body.dark .slider {
  background: rgba(180,140,255,0.3);
}
body.dark input:checked + .slider {
  background-color: #a57fff;
}

@keyframes slideInPanel {
  from {
    transform: translate(30px, -10px);
    opacity: 0;
  }
  to {
    transform: translate(0, 0);
    opacity: 1;
  }
}

body.dark .music-panel.show {
  box-shadow: 0 0 15px rgba(180,140,255,0.4), -2px 4px 10px rgba(180,140,255,0.3);
}

/* ===== 主视觉区样式调整 ===== */

/* 扩大主视觉区整体空间 */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  width: 100%;
  padding: 20px 0 60px 0;
  gap: 25px;
  /* 自动根据内容高度适配，而不是固定视口高度 */
  height: auto;
  min-height: 100vh; /* 保证主视觉区仍至少满屏 */
  box-sizing: border-box;
}

/* 调整主标题与间距 */
.hero h1 {
  font-size: 2.5rem;
  line-height: 1.6;
  margin-bottom: 10px;
}

/* ===== 更新后的主视觉图片样式 ===== */
.hero-image {
  width: 65%;
  margin: 0 auto 20px auto; /* 图片底部留一点间距 */
  overflow: hidden;
  border-radius: 0; /* 顶部横向铺满，不要圆角 */
  box-shadow: 0 4px 12px rgba(255,182,193,0.3);
}

/* 确保图片不会挤压下方文字 */
.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* 让主视觉图片自动撑高但不溢出 */
.hero-image img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.hero-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform 1.5s ease, filter 0.5s ease;
}

/* 夜间模式：轻微暗化 */
body.dark .hero-image img {
  filter: brightness(0.9) saturate(0.9);
  box-shadow: 0 4px 14px rgba(180,140,255,0.35);
}

/* ===== 淡入 + 上浮动画效果 ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 1.5s ease-out both;
}

/* 确保图片动画不会遮挡文字 */
.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 40%);
  pointer-events: none;
}

body.dark .hero-image::after {
  background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 40%);
}

/* ===== 🎵 BanG Dream! Match Game 合并样式 ===== */
.match-game {
  max-width: 800px;
  margin: 60px auto 160px auto; /* 下方留 100px 额外间距 */
  padding: 20px;
  background: rgba(255,255,255,0.6);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(255,182,193,0.3);
  backdrop-filter: blur(8px);
  text-align: center;
}

.match-game h2 {
  color: #ff69b4;
  text-shadow: 1px 1px 2px rgba(255,182,193,0.8);
}

/* 🎴 修复 Match Game 卡牌布局偏移问题 */
.match-game .game-board {
  display: grid;
  grid-template-columns: repeat(5, 120px);
  grid-template-rows: repeat(2, 160px);
  gap: 16px;
  justify-content: center; /* ✅ 水平居中 */
  margin-top: 30px;        /* ✅ 与“开始游戏”按钮保持间距 */
  margin-bottom: 20px;     /* ✅ 与“再来一局”按钮保持间距 */
  perspective: 1000px;
}

/* ===== 🎴 BanG Dream! Match Game 动态展开控制 ===== */

/* 游戏未开始时（默认状态）：隐藏卡牌区域高度 */
/* ===== 🎴 BanG Dream! Match Game 动态展开控制（优化发光不裁切） ===== */

/* 游戏未开始前隐藏卡牌区 */
.match-game .game-board {
  max-height: 0;
  opacity: 0;
  transform: scale(0.98);
  transition: max-height 0.8s ease, opacity 0.6s ease, transform 0.6s ease;
  margin-top: 0;
  margin-bottom: 0;
  pointer-events: none;
}

/* 展开后显示卡牌 */
.match-game.playing .game-board {
  max-height: 500px;
  opacity: 1;
  transform: scale(1);
  margin-top: 30px;
  margin-bottom: 20px;
  pointer-events: auto;
}

/* ✅ 新增：确保卡牌光影完整显示 */
.match-game {
  overflow: visible; /* 让发光外溢显示 */
}

/* 游戏进行时（添加 .playing 类）：卡牌区域展开显示 */
.match-game.playing .game-board {
  max-height: 500px; /* 适合 2×5 布局，可调整 */
  opacity: 1;
  transform: scale(1);
  margin-top: 30px;
}

.match-restart {
  margin-top: 20px;
}

.match-restart button {
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(90deg, #ffb6c1, #ff8fc0);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}
.match-restart button:hover {
  transform: scale(1.05);
  background: linear-gradient(90deg, #ff8fc0, #ff69b4);
}

/* 夜间模式适配 */
body.dark .match-game {
  background: rgba(60,50,80,0.5);
  color: #e8e8f8;
  box-shadow: 0 4px 12px rgba(180,140,255,0.3);
}

/* ===== ✨ 游戏胜利弹窗样式 ===== */
.popup {
  position: fixed;
  top: 100px;
  right: -320px;
  width: 280px;
  background: rgba(255,255,255,0.85);
  border-radius: 16px 0 0 16px;
  box-shadow: -2px 4px 10px rgba(255,182,193,0.3);
  padding: 15px 20px;
  font-size: 16px;
  transition: all 0.5s ease;
  opacity: 0;
  transform: translate(20px, -10px);
  z-index: 200;
  backdrop-filter: blur(10px);
}
.popup.show {
  right: 0;
  opacity: 1;
  animation: slideInPanel 0.4s ease-out;
  transform: translate(0, 0);
}
body.dark .popup {
  background: rgba(40,30,60,0.8);
  color: #e8e8f8;
  box-shadow: -2px 4px 10px rgba(180,140,255,0.3);
}

/* ===== 特别鸣谢弹窗样式 ===== */

/* 模态背景 */
.credit-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(6px);
  justify-content: center;
  align-items: center;
  z-index: 200;
  animation: fadeIn 0.4s ease;
}

/* 弹窗主体（110% 放大版 + 柔光效果） */
.credit-content {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 20px;
  box-shadow: 0 0 25px rgba(255, 182, 193, 0.5);
  width: 450px;
  padding: 50px 35px;
  text-align: center;
  position: relative;
  animation: popup 0.4s ease, glowExpand 0.8s ease-out;
  overflow: hidden;
  font-size: 1.1rem; /* 全体文字放大 110% */
  line-height: 1.8; /* 增加行距，让文字更通透 */
}

/* 标题 */
.credit-content h2 {
  margin-bottom: 15px;
  color: #ff69b4;
  font-size: 1.55rem; /* 原来1.4rem → 放大 */
  letter-spacing: 0.5px;
}

/* 正文文字 */
.credit-content p {
  margin: 8px 0;
  font-size: 1.1rem;
  color: #555;
}

/* 底部按钮区域 */
.credit-footer {
  text-align: right;
  margin-top: 50px; /* 保持底部留白 */
}

/* 按钮整体放大 */
.credit-footer button {
  padding: 8px 20px; /* 增大点击面积 */
  border: none;
  border-radius: 12px;
  background: linear-gradient(90deg, #ffb6c1, #ff8fc0);
  color: white;
  font-size: 1.05rem; /* 原1rem → 放大 */
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.credit-footer button:hover {
  transform: scale(1.07);
  background: linear-gradient(90deg, #ff8fc0, #ff69b4);
}

/* 夜间模式字体微调 */
body.dark .credit-content {
  background: rgba(40, 30, 60, 0.9);
  color: #e8e8f8;
}
body.dark .credit-content h2 {
  color: #b7a5ff;
}
body.dark .credit-footer button {
  background: linear-gradient(90deg, #8c6aff, #b27cff);
}
body.dark .credit-footer button:hover {
  background: linear-gradient(90deg, #b27cff, #8c6aff);
}

/* 动画 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes popup {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* 显示状态 */
.credit-modal.show {
  display: flex;
}

/* 柔光扩散动画 */
@keyframes glowExpand {
  0% {
    box-shadow: 0 0 0px rgba(255,182,193,0.0);
  }
  40% {
    box-shadow: 0 0 40px rgba(255,182,193,0.6);
  }
  100% {
    box-shadow: 0 0 20px rgba(255,182,193,0.3);
  }
}

/* 夜间模式柔光为粉紫色 */
body.dark .credit-content {
  animation: popup 0.4s ease, glowExpandNight 0.8s ease-out;
}
@keyframes glowExpandNight {
  0% {
    box-shadow: 0 0 0px rgba(180,140,255,0.0);
  }
  40% {
    box-shadow: 0 0 45px rgba(180,140,255,0.6);
  }
  100% {
    box-shadow: 0 0 25px rgba(180,140,255,0.3);
  }
}

/* werewolf game styles (追加到 style.css) */
.werewolf { padding: 24px; border-top: 1px solid rgba(255,255,255,0.06); }
.wolf-control { display:flex; gap:12px; align-items:center; margin-bottom:12px; }
#wroomList, #playerList, #chatMessages { margin-top:12px; }
#roomList .room-card { padding:10px; border:1px solid rgba(255,255,255,0.05); margin-bottom:8px; border-radius:8px; }
#playerList { display:flex; flex-direction:column; gap:6px; }
#chatArea { margin-top:12px; }
#chatMessages { max-height:200px; overflow:auto; border:1px solid rgba(255,255,255,0.03); padding:8px; border-radius:6px; background:rgba(0,0,0,0.03); }

.explore-buttons-wrapper {
  display:flex;
  justify-content:center;
  padding: 30px 0;
  background: transparent;
}
.explore-btns { display:flex; gap:18px; flex-wrap:wrap; align-items:center; justify-content:center; }
.card-btn {
  background: rgba(255,255,255,0.6);
  padding: 14px 22px;
  border-radius: 12px;
  border: none;
  font-weight:700;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  cursor:pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card-btn:hover { transform: translateY(-6px); box-shadow: 0 12px 24px rgba(0,0,0,0.12); }

.footer { text-align:center; padding:18px 10px; color:#fff; background: rgba(0,0,0,0.06); }
.footer .copyright { margin-top:8px; font-size:0.9rem; color: rgba(255,255,255,0.9); }

/* 简洁模态样式 */
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 2000; }
.modal[aria-hidden="false"] { display:flex; }
.modal-backdrop { position:absolute; inset:0; background:rgba(0,0,0,0.45); }
.modal-panel { position:relative; background: #fff; border-radius:12px; padding:20px; width: 360px; max-width:90%; box-shadow: 0 20px 60px rgba(0,0,0,0.35); z-index:2; font-family:inherit; }
.modal-panel h3 { margin:0 0 10px; font-size:1.2rem; }
.modal-close { position:absolute; right:8px; top:8px; border:none; background:transparent; font-size:16px; cursor:pointer; }
.auth-step label { display:block; margin:10px 0 6px; font-size:0.9rem; color:#333; }
.auth-step input { width:100%; padding:10px 12px; border-radius:8px; border:1px solid #e6e6e6; }
.row { display:flex; gap:10px; margin-top:12px; }
.btn { padding:8px 14px; border-radius:8px; border:none; cursor:pointer; background:#0ea5e9; color:#fff; font-weight:600; }
.btn.alt { background:transparent; border:1px solid #e5e7eb; color:#333; }
.auth-msg { margin-top:10px; color:#ef4444; font-size:0.9rem; }

/* 背景图片 modal 继承 modal 面板样式，复用上面类 */

/* 聊天区核心 */
.global-chat { padding: 24px; }
#chatApp{width:100%;height:500px;background:rgba(255,255,255,0.06);border-radius:12px;display:flex;overflow:hidden;border:1px solid rgba(0,0,0,0.06);backdrop-filter: blur(6px);}
#sidebar{width:260px;background:transparent;display:flex;flex-direction:column;border-right:1px solid rgba(255,255,255,0.03)}
#main{display:flex;flex-direction:column;flex:1}
#messages{flex:1;padding:18px;overflow-y:auto}
.msg{margin-bottom:12px;display:flex;align-items:flex-end;gap:8px}
.msg.own{flex-direction:row-reverse}
.bubble{max-width:70%;padding:10px 14px;border-radius:14px;position:relative;word-break:break-word}
.msg:not(.own) .bubble{background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.02);color:#000}
.msg.own .bubble{background:linear-gradient(135deg,#0ea5e9,#6366f1);color:#fff}
.time{font-size:11px;color:rgba(255,255,255,0.6);margin:6px 0 0}
#input{width:100%;background:rgba(255,255,255,0.02);border:none;border-radius:12px;padding:10px}
#sendBtn{background:linear-gradient(135deg,#0ea5e9,#6366f1);border-radius:8px;color:#fff;padding:8px 12px;border:none;cursor:pointer}

/* ============================================================
   通用按钮样式（与日夜模式切换按钮一致）
   ============================================================ */

.ui-button,
.ui-button-small,
.ui-button-outline {
  display: inline-block;
  cursor: pointer;
  padding: 10px 18px;
  border-radius: 12px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease;
  user-select: none;
}

/* 主按钮 */
.ui-button {
  background: #ff8bb0;
  color: white;
}
.ui-button:hover {
  transform: scale(1.08);
  background: #ff76a1;
}

/* 小按钮（右上角登录 / 注册） */
.ui-button-small {
  background: #ff8bb0;
  color: white;
  padding: 6px 12px;
  font-size: 14px;
}
.ui-button-small:hover {
  transform: scale(1.10);
  background: #ff76a1;
}

/* outline 按钮（次级按钮） */
.ui-button-outline {
  border: 2px solid #ff8bb0;
  background: white;
  color: #ff4d89;
}
.ui-button-outline:hover {
  transform: scale(1.06);
  background: #ffe1eb;
}

/* 按钮禁用状态（点击后防多次） */
.ui-button.disabled,
.ui-button-small.disabled,
.ui-button-outline.disabled {
  opacity: 0.6;
  pointer-events: none;
  background: #c46e89;
}

/* ============================================================
   登录系统弹窗基础样式
   ============================================================ */

.login-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  backdrop-filter: blur(2px);
}

.login-modal.active {
  display: flex;
}

.login-box {
  background: white;
  width: 330px;
  padding: 30px 28px;
  border-radius: 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: loginFadeIn 0.25s ease;
}

@keyframes loginFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-box h2 {
  margin-bottom: 10px;
  font-size: 20px;
  font-weight: 700;
}

.login-box input {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #ccc;
  font-size: 15px;
  width: 100%;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.login-box input:focus {
  border: 1px solid #ff8bb0;
  box-shadow: 0 0 4px rgba(255, 105, 135, 0.3);
  outline: none;
}

/* 关闭按钮 */
.ui-close {
  background: #dddddd;
  padding: 7px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}
.ui-close:hover {
  background: #cfcfcf;
}


/* ============================================================
   用户菜单（登录后右上角）
   ============================================================ */

.user-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.user-menu .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
  transition: transform 0.15s ease;
}

.user-menu:hover .avatar {
  transform: scale(1.10);
}

#userName {
  font-weight: 600;
  color: #333;
}

/* 下拉菜单 */
.user-menu .dropdown-menu {
  position: absolute;
  top: 48px;
  right: 0;
  background: white;
  border-radius: 12px;
  width: 150px;
  padding: 6px 0;
  display: none;
  flex-direction: column;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  z-index: 999;
}

.user-menu .dropdown-menu a {
  padding: 10px 16px;
  text-align: left;
  color: #444;
  cursor: pointer;
  transition: background 0.15s ease;
}

.user-menu .dropdown-menu a:hover {
  background: #f4f4f4;
}

/* 展示时 */
.user-menu.show .dropdown-menu {
  display: flex;
}

/* ============================================================
   账号设置面板
   ============================================================ */

#accountSettingsModal .login-box input {
  margin-top: 4px;
}

#accountCreatedModal .modal-box {
  max-width: 380px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px; /* 控制日夜按钮和登录按钮之间的距离 */
}

#openLoginBtn.ui-button-small {
  padding: 6px 14px;
  font-size: 14px;
}
