* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #1e90ff, #00c2ff);
  min-height: 100vh;
  color: #fff;
}
.container { max-width: 500px; margin: 0 auto; padding: 15px; }

.header {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(255,255,255,0.95); color: #333;
  padding: 12px 20px; border-radius: 16px; margin-bottom: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  font-weight: 700; font-size: 18px;
}

.progress-bar { height: 10px; background: rgba(255,255,255,0.4); border-radius: 5px; overflow: hidden; margin-bottom: 20px; }
.progress-fill { height: 100%; width: 0%; background: #58cc02; border-radius: 5px; transition: width 0.6s ease; }

.character { text-align: center; margin: 20px 0; }
#duo-img { height: 140px; transition: transform 0.4s; }

.task-card {
  background: white; color: #333; border-radius: 24px;
  padding: 30px 20px; box-shadow: 0 12px 30px rgba(0,0,0,0.2);
  text-align: center;
}
#question { font-size: 24px; margin-bottom: 30px; font-weight: 600; }

.blocks-area, .dropzone {
  display: flex; flex-wrap: wrap; gap: 14px;
  justify-content: center; margin: 30px 0; padding: 20px;
  min-height: 120px;
}

/* Основные члены (a², 2ab и т.д.) */
.term-block {
  background: #58a6ff; color: white; padding: 14px 20px;
  border-radius: 14px; font-weight: 600; user-select: none;
  cursor: grab; box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  min-width: 70px; transition: all 0.2s;
}
.term-block:active { cursor: grabbing; transform: scale(1.08); }

/* Знаки + и − */
.sign-block {
  background: #95a5a6 !important; color: white !important;
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold; font-size: 28px; cursor: grab;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.sign-block:active { transform: scale(1.15); }

/* В зоне ответа — другие цвета */
#answer-area .term-block { background: #3498db; }
#answer-area .sign-block { background: #7f8c8d !important; }

.dropzone {
  border: 3px dashed #b3d9ff; background: #f8fdff;
  border-radius: 18px; position: relative;
}
.dropzone.over { border-color: #58a6ff; background: #e3f2fd; }
.placeholder {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  color: #aaa; font-size: 18px; pointer-events: none;
  transition: opacity 0.3s ease;
}

.buttons { margin: 30px 0; }
.btn-primary, .btn-success {
  padding: 16px 36px; border: none; border-radius: 14px;
  font-size: 18px; font-weight: 700; cursor: pointer; transition: 0.2s;
}
.btn-primary { background: #1e90ff; color: white; }
.btn-success { background: #58cc02; color: white; }
.btn-primary:disabled {
  background: #95a5a6 !important; cursor: not-allowed; opacity: 0.7;
}

.result { margin-top: 20px; font-size: 22px; font-weight: 600; min-height: 60px; }