* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #E8F5E9;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #333;
  user-select: none;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#hud {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: auto;
}

#punch-counter {
  display: inline-block;
  background: rgba(255, 255, 255, 0.95);
  padding: 10px 24px;
  border-radius: 30px;
  font-size: 1.5rem;
  font-weight: bold;
  color: #FF7043;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border: 3px solid #FF7043;
}

.screen {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  max-width: 420px;
  background: #ffffff;
  padding: 30px 20px;
  border-radius: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  text-align: center;
  z-index: 20;
  pointer-events: auto;
  border: 4px solid #E8F5E9;
}

.screen h1 {
  font-size: 2rem;
  margin-bottom: 12px;
  color: #FF7043;
}

.screen p {
  font-size: 1.1rem;
  margin-bottom: 24px;
  color: #555;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
  transition: transform 0.1s, background-color 0.2s;
}

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

#btnStart, #btnRestart {
  background-color: #FF7043;
  color: #fff;
  font-size: 1.3rem;
  font-weight: bold;
  padding: 14px 32px;
  border-radius: 50px;
  box-shadow: 0 4px 0 #D84315;
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
  display: block;
}

#btnStart:hover, #btnRestart:hover {
  background-color: #F4511E;
}

#controls {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  pointer-events: auto;
  width: 100%;
  display: flex;
  justify-content: center;
}

#btnPunch {
  background-color: #FF7043;
  color: #fff;
  font-size: 1.6rem;
  font-weight: bold;
  padding: 18px 48px;
  border-radius: 60px;
  box-shadow: 0 6px 0 #D84315;
  min-width: 180px;
  user-select: none;
}

#btnPunch:hover {
  background-color: #F4511E;
}

@media (max-width: 480px) {
  .screen {
    width: 90%;
    padding: 24px 16px;
  }
  .screen h1 {
    font-size: 1.6rem;
  }
  #punch-counter {
    font-size: 1.2rem;
    padding: 8px 18px;
  }
  #btnPunch {
    font-size: 1.4rem;
    padding: 16px 40px;
  }
}