html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  color: #111;
}

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
}

#app-root {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 14px 0 24px 0;
  box-sizing: border-box;
}

canvas {
  display: block;
}

.app-shell {
  position: relative;
  width: 1180px;
  max-width: 1180px;
  box-sizing: border-box;
}

.panel-box {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  background: #f3f3f3;
  border: 1px solid #cfcfcf;
  border-radius: 14px;
  overflow: hidden;
  margin: 0;
}

.info-panel {
  padding: 18px 24px 14px 24px;
}

.info-title {
  margin: 0 0 10px 0;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 700;
  color: #111;
}

.info-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: #333;
  max-width: 900px;
}

.preview-panel {
  position: relative;
  padding: 0;
  margin: 0;
}

.controls-panel {
  position: relative;
  padding: 0;
  margin: 0;
}

.preview-help {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 9998;
  font-size: 15px;
  line-height: 1.3;
  color: #333;
  user-select: none;
  pointer-events: none;
  background: none;
  border: none;
  padding: 0;
  box-shadow: none;
}

.questionnaire-shell {
  width: 100%;
  box-sizing: border-box;
}

.questionnaire-page {
  width: 100%;
  box-sizing: border-box;
  background: #f3f3f3;
  border: 1px solid #cfcfcf;
  border-radius: 14px;
  padding: 28px 28px 24px 28px;
}

.questionnaire-title {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 700;
  color: #111;
}

.questionnaire-instruction {
  margin: 0 0 24px 0;
  font-size: 18px;
  line-height: 1.45;
  color: #222;
}

.question-box {
  background: #ffffff;
  border: 1px solid #d9d9d9;
  border-radius: 12px;
  padding: 18px 18px 16px 18px;
  margin-bottom: 18px;
  box-sizing: border-box;
}

.question-title {
  margin: 0 0 14px 0;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 600;
  color: #111;
}

.question-submit-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 10px;
}

.question-submit-button {
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 700;
  border: 1px solid #999;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
}

.question-submit-button:disabled {
  cursor: default;
}

.question-message {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
}

/* ---------- CUP STAGE LAYOUT ---------- */
.main-stage-row {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 18px;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.left-column {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  display: block;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  align-self: flex-start;
}

.right-column {
  width: 920px;
  min-width: 920px;
  max-width: 920px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 18px;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  align-self: flex-start;
}

.instruction-panel {
  width: 220px;
  height: 818px;
  margin: 0;
  padding: 20px 16px;
  box-sizing: border-box;
}

.instruction-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  height: 100%;
  box-sizing: border-box;
}

.instruction-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
  color: #111;
  text-align: justify;
}

.instruction-page-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  color: #111;
  text-align: left;
}

.instruction-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #333;
  text-align: left;
}

.instruction-image {
  width: 100%;
  max-width: 150px;
  height: auto;
  object-fit: contain;
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  background: #ffffff;
  padding: 6px;
  box-sizing: border-box;
}

.right-column > .preview-panel {
  width: 920px;
  height: 360px;
  margin: 0;
  box-sizing: border-box;
}

.right-column > .controls-panel {
  width: 920px;
  height: 440px;
  margin: 0;
  box-sizing: border-box;
}

@media (max-width: 1240px) {
  .app-shell {
    width: 96vw;
    max-width: 96vw;
  }

  .main-stage-row {
    gap: 18px;
  }

  .left-column {
    width: 210px;
    min-width: 210px;
    max-width: 210px;
  }

  .instruction-panel {
    width: 210px;
  }

  .right-column {
    width: calc(100% - 228px);
    min-width: 0;
    max-width: none;
    flex: 1;
  }

  .right-column > .preview-panel,
  .right-column > .controls-panel {
    width: 100%;
  }
}

