/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: '小米兰亭 Pro VF', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background-color: #f0f2f5;
  color: #555;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===== Page Wrapper ===== */
.page-wrapper {
  max-width: 520px;
  margin: 40px auto;
  padding: 0 16px;
}

/* ===== Back Button ===== */
.btn-back {
  display: inline-block;
  padding: 10px 28px;
  background: #fff;
  color: #2C9AB7;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
}

.btn-back:hover {
  background: linear-gradient(135deg, #52bad5, #2C9AB7);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(44, 154, 183, 0.3);
}

/* ===== Game Card ===== */
.game-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.game-header {
  background: linear-gradient(135deg, #52bad5, #2C9AB7);
  padding: 28px 24px;
  text-align: center;
}

.game-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 4px;
  margin-bottom: 6px;
}

.game-header p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 1px;
}

/* ===== Game Body ===== */
.game-body {
  padding: 20px 24px 28px;
}

/* ===== Score Board ===== */
.score-board {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 16px;
}

.score-item {
  text-align: center;
}

.score-label {
  display: block;
  font-size: 12px;
  color: #aaa;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.score-value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: #2C9AB7;
}

/* ===== Canvas ===== */
.canvas-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
}

#gameCanvas {
  border: 2px solid #eee;
  border-radius: 8px;
  background: #1a1a2e;
  display: block;
  max-width: 100%;
  height: auto;
}

/* ===== Overlay ===== */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(26, 26, 46, 0.85);
  border-radius: 8px;
  transition: opacity 0.3s ease;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-text {
  color: #fff;
  font-size: 16px;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.btn-start {
  display: inline-block;
  padding: 10px 32px;
  background: linear-gradient(135deg, #52bad5, #2C9AB7);
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(44, 154, 183, 0.3);
  font-family: inherit;
}

.btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(44, 154, 183, 0.4);
}

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

/* ===== Action Bar ===== */
.action-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.btn-action {
  padding: 10px 28px;
  border: 1px solid #2C9AB7;
  background: transparent;
  color: #2C9AB7;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-action:hover {
  background: #2C9AB7;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(44, 154, 183, 0.25);
}

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

/* ===== Mobile Controls ===== */
.controls-mobile {
  display: none;
  margin-top: 20px;
}

.ctrl-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.ctrl-btn {
  width: 56px;
  height: 56px;
  border: 2px solid #eee;
  background: #fff;
  border-radius: 12px;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.ctrl-btn:active {
  background: #52BAD5;
  border-color: #52BAD5;
  color: #fff;
  transform: scale(0.93);
}

/* ===== Footer ===== */
.site-footer {
  padding: 28px 20px;
  text-align: center;
}

.site-footer .copyright {
  color: #ccc;
  font-size: 13px;
  letter-spacing: 2px;
}

.site-footer .copyright a {
  color: #fff;
  font-weight: 600;
  border-bottom: 1px dashed rgba(255,255,255,0.4);
  padding-bottom: 1px;
}

.site-footer .copyright a:hover {
  opacity: 1;
  border-bottom-color: #fff;
}

/* ===== Responsive ===== */
@media (max-width: 548px) {
  .page-wrapper {
    margin: 20px auto;
    padding: 0 10px;
  }

  .game-header h1 {
    font-size: 22px;
  }

  .game-body {
    padding: 16px 12px 20px;
  }

  .score-value {
    font-size: 24px;
  }

  .controls-mobile {
    display: block;
  }
}

@media (min-width: 549px) {
  .controls-mobile {
    display: none;
  }
}
