:root {
  --bg-color: #0a0a0c;
  --board-bg: #1a1a24;
  --cell-bg: #2d2d3d;
  --cell-hover: #3d3d52;
  --cell-revealed: #14141c;
  --text-color: #d3d3e0;
  --blood-red: #8a0303;
  --neon-purple: #8a2be2;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Courier New', Courier, monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  transition: background-color 0.2s ease;
}

/* 踩雷时的夸张全屏震颤与血光特效 */
body.blood-shake {
  background-color: var(--blood-red);
  animation: dungeon-shake 0.4s infinite cubic-bezier(.36,.07,.19,.97) both;
}

.dungeon-container {
  text-align: center;
  background: linear-gradient(145deg, #111118, #0a0a0c);
  padding: 30px;
  border-radius: 15px;
  border: 2px solid var(--neon-purple);
  box-shadow: 0 0 30px rgba(138, 43, 226, 0.3);
}

.title {
  font-size: 2rem;
  color: #fff;
  text-shadow: 0 0 10px var(--neon-purple);
  margin-bottom: 20px;
}
.title span { font-size: 1rem; color: #888; display: block; margin-top: 5px;}

.control-panel, .stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.dark-btn, .dark-select {
  background: var(--bg-color);
  color: var(--text-color);
  border: 1px solid var(--neon-purple);
  padding: 10px 15px;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.dark-btn:hover { background: var(--neon-purple); color: #fff; box-shadow: 0 0 15px var(--neon-purple); }

.stat-box {
  background: #000;
  padding: 10px 20px;
  border: 1px inset #444;
  font-weight: bold;
  color: #ff3333;
}

#game-status { color: var(--neon-purple); }

/* 地牢网格系统 */
.board {
  display: grid;
  gap: 2px;
  background: #000;
  padding: 2px;
  border: 3px solid #333;
  margin: 0 auto;
}

.cell {
  width: 30px;
  height: 30px;
  background-color: var(--cell-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.1s;
  border-radius: 2px;
}

.cell:hover:not(.revealed) { background-color: var(--cell-hover); }

.cell.revealed { background-color: var(--cell-revealed); box-shadow: inset 0 0 5px #000; cursor: default; }

/* 陷阱爆炸动画 */
.cell.exploded {
  background-color: var(--blood-red);
  font-size: 22px;
  animation: trap-pop 0.3s ease-out forwards;
}

/* 驱散黑暗的蜡烛 */
.cell.flag { font-size: 20px; }

/* 各种数字的魔法光泽 */
.val-1 { color: #4da6ff; } .val-2 { color: #66ff66; } .val-3 { color: #ff6666; }
.val-4 { color: #b366ff; } .val-5 { color: #ffeb3b; } .val-6 { color: #00e6e6; }
.val-7 { color: #ff9933; } .val-8 { color: #ff00ff; }

@keyframes trap-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.5); text-shadow: 0 0 20px #ff0000; }
  100% { transform: scale(1); }
}

@keyframes dungeon-shake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-1deg); }
  20% { transform: translate(-3px, 0px) rotate(1deg); }
  30% { transform: translate(3px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translate(-3px, 1px) rotate(0deg); }
  70% { transform: translate(3px, 1px) rotate(-1deg); }
  80% { transform: translate(-1px, -1px) rotate(1deg); }
  90% { transform: translate(1px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }
}
