* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: #f2f4f8; }

.cp-outer { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.cp-container { width: 100%; max-width: 760px; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 18px 45px rgba(0,0,0,0.15); }

.cp-header {
  background: #1c4e9e; color: #fff; padding: 12px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.cp-instruction { font-size: 13px; font-weight: 600; }
.cp-header-right { display: flex; align-items: center; gap: 14px; }
.cp-life { font-size: 13px; font-weight: 700; }
.cp-home-btn { background: #2ecc71; color: #fff; border: none; border-radius: 20px; padding: 6px 16px; font-size: 12px; font-weight: 700; cursor: pointer; }

.cp-loading, .cp-warning { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; gap: 14px; color: #3a3a3a; }
.cp-spinner { width: 36px; height: 36px; border: 4px solid #cfe8ff; border-top-color: #1c4e9e; border-radius: 50%; animation: cp-spin 0.8s linear infinite; }
@keyframes cp-spin { to { transform: rotate(360deg); } }
.cp-warning-icon { font-size: 40px; }

.cp-scene {
  position: relative;
  background: #b6e8ec;
  min-height: 420px;
  padding: 24px;
}
.cp-select-label {
  display: inline-block;
  background: #fff; border: 2px solid #2c3e50; border-radius: 10px;
  padding: 12px 24px; font-size: 22px; font-weight: 800; color: #2c3e50;
  position: relative; left: 50%; transform: translateX(-50%);
  margin-bottom: 20px;
}
.cp-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.cp-svg path { fill: none; stroke: #2c3e50; stroke-width: 0.6; stroke-linecap: round; }

#dotsArea { position: relative; width: 100%; height: 340px; }
.cp-dot {
  position: absolute;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd27a, #ff9f1c 75%);
  color: #fff; font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  transition: transform 0.15s;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.cp-dot:hover { transform: translate(-50%, -50%) scale(1.1); }
.cp-dot.done { background: radial-gradient(circle at 35% 30%, #baffce, #2ecc71 75%); }
.cp-dot.wrong { animation: cp-shake 0.4s; }
@keyframes cp-shake { 0%,100% { transform: translate(-50%,-50%); } 25% { transform: translate(-56%,-50%); } 75% { transform: translate(-44%,-50%); } }

.cp-result { text-align: center; padding: 50px 30px; }
.cp-result-icon { font-size: 56px; margin-bottom: 8px; }
.cp-result h2 { margin: 0 0 8px; color: #2f3542; }
.cp-result p { color: #6b6b6b; margin: 0 0 26px; }
.cp-result-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

.cp-btn { border: none; border-radius: 12px; padding: 12px 26px; font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.cp-btn-primary { background: #2ecc71; color: #fff; }
.cp-btn-secondary { background: #5b8def; color: #fff; }

.cp-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.cp-modal { background: #fff; border-radius: 16px; padding: 26px 24px; max-width: 340px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.3); }
.cp-modal p { font-size: 15px; font-weight: 600; color: #2f3542; margin: 0 0 18px; }
.cp-modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 560px) {
  .cp-instruction { flex-basis: 100%; text-align: center; order: 1; font-size: 11px; }
  .cp-header-right { order: 2; margin: 0 auto; }
  .cp-select-label { font-size: 17px; padding: 9px 16px; }
  .cp-dot { width: 28px; height: 28px; font-size: 12px; }
  .cp-btn { width: 100%; justify-content: center; }
}
