* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #fafafa; }
body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  color: #1a1a1a;
}
canvas { display: block; background: #fafafa; touch-action: none; }

/* ===== Survey overlay ===== */
#survey-ui {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 200ms ease;
}
#survey-ui.hidden { opacity: 0; pointer-events: none; }

.survey-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 20px;
  padding: 28px 24px 24px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
  border: 1px solid #efefef;
}

.survey-header {
  font-size: 13px;
  font-weight: 500;
  color: #888;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  text-align: center;
}

.progress-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 28px;
}
.progress-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e5e5e5;
  transition: background 200ms ease;
}
.progress-dots .dot.active { background: #1a1a1a; }

.question-text {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 28px;
  min-height: 54px;
}

.answer-area { display: flex; flex-direction: column; gap: 10px; }

/* Scale 1-5 row */
.scale-row {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}
.scale-btn {
  flex: 1;
  aspect-ratio: 1 / 1;
  border: 1px solid #e5e5e5;
  background: #fff;
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  cursor: pointer;
  transition: all 120ms ease;
}
.scale-btn:hover { background: #f5f5f5; }
.scale-btn:active { background: #1a1a1a; color: #fff; transform: scale(0.96); }
.scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 11px;
  color: #999;
}

/* Yes / No */
.yesno-row { display: flex; gap: 10px; }
.yesno-btn {
  flex: 1;
  padding: 18px 0;
  border: 1px solid #e5e5e5;
  background: #fff;
  border-radius: 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  cursor: pointer;
  transition: all 120ms ease;
}
.yesno-btn:hover { background: #f5f5f5; }
.yesno-btn:active { background: #1a1a1a; color: #fff; transform: scale(0.97); }

/* ===== Result overlay ===== */
#result-ui {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.04);
  opacity: 0;
  transition: opacity 400ms ease;
}
#result-ui.show { display: flex; opacity: 1; }

.result-card {
  width: 100%;
  max-width: 320px;
  background: #ffffff;
  border-radius: 20px;
  padding: 32px 24px 24px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  border: 1px solid #efefef;
  text-align: center;
}

.result-label {
  font-size: 13px;
  color: #888;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.result-percent {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 8px 0 12px;
  line-height: 1.1;
}

.result-comment {
  font-size: 14px;
  color: #555;
  line-height: 1.5;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.restart-btn {
  width: 100%;
  padding: 14px 0;
  border: none;
  background: #1a1a1a;
  color: #fff;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 120ms ease;
}
.restart-btn:hover { background: #000; }
.restart-btn:active { transform: scale(0.98); }
