/* 基礎設定：使用清爽的漸層背景 */
body {
  margin: 0;
  padding: 20px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  color: white;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#font {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  margin: 10px 0;
}

h1 {
  font-size: 2.5rem;
  letter-spacing: 2px;
}

/* 裝飾外框：磨砂玻璃效果 */
.decoration {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: 15px 25px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  display: flex;
  gap: 20px;
  align-items: center;
}

/* 控制列優化 */
#game-operation select,
#game-button {
  padding: 8px 15px;
  border-radius: 8px;
  border: none;
  outline: none;
  cursor: pointer;
  font-weight: bold;
}

#game-button {
  background-color: #4caf50;
  color: white;
  transition:
    transform 0.2s,
    background-color 0.2s;
}

#game-button:hover {
  background-color: #45a049;
  transform: scale(1.05);
}

#game-button:active {
  transform: scale(0.95);
}

/* 遊戲區域：試管排列 */
#game-area {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  max-width: 800px;
  padding: 40px;
}

/* 試管樣式：加上厚度感與圓角 */
.tube {
  width: 50px;
  height: 180px;
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-top: none;
  border-bottom-left-radius: 25px;
  border-bottom-right-radius: 25px;
  display: flex;
  flex-direction: column-reverse; /* 讓水從底部開始堆疊 */
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  position: relative;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 當試管被選中時的動畫 */
.tube.selected {
  transform: translateY(-20px);
  box-shadow: 0 15px 20px rgba(0, 0, 0, 0.4);
  border-color: #ffeb3b;
}

/* 水層樣式：讓顏色過渡更自然 */
.water {
  width: 100%;
  transition: all 0.3s ease;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* 增加一點亮光效果在液體上 */
.water::after {
  content: "";
  display: block;
  width: 30%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  margin-left: 10%;
}

/* 數據顯示 */
#level-count,
#completed-tubes-count {
  font-weight: bold;
  color: #ffeb3b;
  font-size: 1.2rem;
  margin-left: 5px;
}
