/* D:\mywebsite\html\kill_time\Go\go.css */

body {
  margin: 0;
  padding: 20px;
  font-family: "Microsoft JhengHei", system-ui, -apple-system, BlinkMacSystemFont;

  background:
    linear-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.35)),
    url("BG.jpg?v=20251227-2") no-repeat center center fixed;
  background-size: cover;

  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  box-sizing: border-box;
}

h1 {
  margin: 0 0 14px 0;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  text-shadow: 0 0 8px #000;
  font-size: clamp(20px, 3vw, 26px);
}

/* 棋盤框 */
#board-wrapper {
  position: relative;
  width: min(860px, 96vw);
  aspect-ratio: 1 / 1;
  
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  background: rgba(0, 0, 0, 0.15);
}

/* canvas：棋盤 + 棋子 + 點擊 */
#board-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  touch-action: none; /* 避免手機手勢干擾 */
}

/* 操作按鈕區 */
#controls {
  margin-top: 14px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

#controls button {
  padding: 6px 14px;
  font-size: 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  background: linear-gradient(135deg, #ffd36a, #ffb33a);
  color: #4a3000;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
  white-space: nowrap;
}

#controls button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  filter: brightness(1.05);
}

#controls button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  filter: brightness(0.97);
}

#controls button:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* 狀態文字 */
#status {
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 6px #000;
  font-size: 14px;
}

/* 手機版 */
@media (max-width: 480px) {
  body { padding: 12px; }
  #controls { justify-content: center; }
  #controls button { flex: 1 1 auto; text-align: center; }
}

.loader{
  display:inline-block;
  width:12px;
  height:12px;
  border-radius:50%;
  border:2px solid rgba(255,255,255,.35);
  border-top-color:#fff;
  margin-left:6px;
  vertical-align:middle;
  animation: spin .8s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

/* 右下角固定：返回鍵 */
.back-btn{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;

  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  cursor: pointer;

  font-size: 14px;
  font-weight: 800;

  background: rgba(0,0,0,0.65);
  color: #fff;
  box-shadow: 0 10px 25px rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
}
.back-btn:hover{ filter: brightness(1.08); }
.back-btn:active{ transform: translateY(1px); }
