/* 全局重置与基础样式 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f0f8ff;
  color: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 16px;
}

#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 100%;
}

#game {
  display: grid;
  grid-template-columns: repeat(3, 100px);
  grid-gap: 4px;
  background-color: #ccc;
  padding: 8px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.tile,
.blank {
  width: 100px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  background-color: #4caf50;
  color: white;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s ease, background-color 0.2s ease;
}

.tile:hover {
  background-color: #45a049;
  transform: scale(1.02);
}

.blank {
  background-color: #e0e0e0;
  color: #aaa;
  cursor: default;
}

button {
  padding: 12px 24px;
  font-size: 18px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  background-color: #4caf50;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

button:hover {
  background-color: #45a049;
}

button:active {
  transform: scale(0.98);
}

/* 响应式适配 */
@media (max-width: 480px) {
  #game {
    grid-template-columns: repeat(3, 80px);
  }

  .tile,
  .blank {
    width: 80px;
    height: 80px;
    font-size: 20px;
  }
}