* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; -webkit-user-select: none; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background-color: #fffacd;
  color: #555;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  touch-action: manipulation;
}
#app {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  background-color: #fff8dc;
  touch-action: none;
}

.hidden { display: none !important; }

.overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}
.card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 24px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.title {
  font-size: 28px;
  font-weight: 800;
  color: #ff6961;
  margin-bottom: 12px;
  letter-spacing: 1px;
}
.desc {
  font-size: 16px;
  color: #666;
  margin-bottom: 20px;
  line-height: 1.5;
}

.diff-group {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}
.diff-btn {
  flex: 1;
  padding: 10px 0;
  border: 2px solid #ffe4e1;
  background: #fff;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  transition: all 0.2s ease;
}
.diff-btn:hover { background: #ffe4e1; }
.diff-btn:active { transform: scale(0.96); }
.diff-btn.active {
  background: #ff6961;
  border-color: #ff6961;
  color: #fff;
  box-shadow: 0 4px 0 #d94a45;
  transform: scale(1.02);
}

.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.btn-primary, .btn-secondary {
  flex: 1;
  padding: 14px 0;
  border: none;
  border-radius: 14px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
}
.btn-primary {
  background-color: #ff6961;
  color: #fff;
  box-shadow: 0 4px 0 #d94a45;
}
.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #d94a45;
}
.btn-secondary {
  background-color: #ffe4e1;
  color: #666;
  box-shadow: 0 4px 0 #d4b8b5;
}
.btn-secondary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #d4b8b5;
}

#hud {
  position: absolute;
  top: 16px;
  left: 0; right: 0;
  display: flex;
  justify-content: space-around;
  padding: 0 16px;
  z-index: 5;
  pointer-events: none;
}
.hud-item {
  background: rgba(255, 255, 255, 0.92);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: bold;
  color: #555;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border: 2px solid #ffe4e1;
}

.score-board {
  margin: 16px 0;
  padding: 16px;
  background: #fff8dc;
  border-radius: 12px;
  border: 2px dashed #ffe4e1;
}
.score-board p { margin: 6px 0; font-size: 18px; color: #555; }
#resultScore { font-weight: bold; color: #ff6961; font-size: 22px; }
#resultMsg { color: #666; }

@media (max-width: 480px) {
  .title { font-size: 24px; }
  .card { padding: 20px; width: 92%; }
  .hud-item { font-size: 14px; padding: 6px 12px; }
  .btn-primary, .btn-secondary { font-size: 16px; padding: 12px 0; }
}