/* 🐠 MC 像素草缸 - 样式表 */

:root {
  --bg-dark: #0f0c29;
  --bg-mid: #302b63;
  --bg-light: #24243e;
  --primary: #7ed6df;
  --primary-dark: #1a5276;
  --btn-bg: linear-gradient(180deg, #3498db, #2980b9);
  --btn-border: #1a5276;
  --btn-active: linear-gradient(180deg, #2ecc71, #27ae60);
  --btn-active-border: #1e8449;
  --text-glow: rgba(126, 214, 223, 0.8);
  --shadow: rgba(126, 214, 223, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-mid) 50%, var(--bg-light) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Courier New', monospace;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

h1 {
  color: var(--primary);
  font-size: 28px;
  margin-bottom: 20px;
  text-shadow: 0 0 20px var(--text-glow);
  letter-spacing: 4px;
  flex-shrink: 0;
}

#game-container {
  position: relative;
  border: 6px solid #1a1a2e;
  border-radius: 4px;
  box-shadow: 
    0 0 40px var(--shadow),
    inset 0 0 80px rgba(126, 214, 223, 0.15);
  overflow: hidden;
  width: 90vw;
  height: calc(100vh - 120px);
  max-width: 1000px;
  max-height: 70vh;
  
  /* ✅ 确保 Canvas 能正确填充 */
  display: flex;
  flex-direction: column;
}

#fish-tank {
  display: block;
  width: 100%;      /* ✅ 填充容器宽度 */
  height: 100%;     /* ✅ 填充容器高度 */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.controls {
  margin-top: 15px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 90vw;
}

.btn {
  background: var(--btn-bg);
  border: 3px solid var(--btn-border);
  color: #fff;
  padding: 8px 16px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(52, 152, 219, 0.6);
  filter: brightness(1.2);
}

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

.btn.active {
  background: var(--btn-active);
  border-color: var(--btn-active-border);
}

.info {
  color: var(--primary);
  font-size: 11px;
  margin-top: 10px;
  text-align: center;
  opacity: 0.8;
  max-width: 90vw;
  line-height: 1.6;
  padding: 0 10px;
}

.info b {
  color: #fff;
}

/* 加载动画 */
#loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--primary);
  font-size: 18px;
  text-shadow: 0 0 10px var(--text-glow);
}

/* FPS 显示器 */
#fps-counter {
  position: absolute;
  top: 10px;
  left: 10px;
  color: #0f0;
  font-size: 10px;
  opacity: 0.7;
}
