* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  padding: 32px 16px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: linear-gradient(180deg, #f3f0e4 0%, #e7e0c8 100%);
  font-family: Georgia, 'Times New Roman', serif;
  color: #3a3320;
}

.card {
  width: 100%;
  max-width: 860px;
  background: #fffdf5;
  border: 1.5px solid #b8862c;
  border-radius: 14px;
  padding: 28px 32px 32px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

h1 { margin: 0 0 6px; color: #4a6b2a; font-size: 28px; }
h2 { margin: 26px 0 8px; color: #4a6b2a; font-size: 19px; }

.hint { margin: 0 0 20px; color: #8a7a4a; font-size: 14px; line-height: 1.5; }
.hint.tight { margin: 0 0 10px; }
.hint b { color: #6a5a2a; }

fieldset {
  border: 1.5px solid #d8cfa8;
  border-radius: 10px;
  padding: 12px 14px 14px;
  margin: 0 0 16px;
}
legend { padding: 0 6px; color: #4a6b2a; font-weight: 700; font-size: 14px; }

.radio { display: flex; align-items: flex-start; gap: 9px; padding: 5px 0; font-size: 14px; cursor: pointer; line-height: 1.4; }
.radio input { margin-top: 3px; flex: none; }

/* Поля выравниваем по НИЗУ: подписи бывают разной высоты, и без этого соседние
   селекты стоят на разном уровне. */
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; margin: 0 0 16px; }
.fld { flex: 1 1 200px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #6a5a2a; }
.fld.small { flex: 0 0 110px; }
.fld input, .fld select {
  font-family: Georgia, serif; font-size: 15px; padding: 8px 10px;
  border: 1.5px solid #d8cfa8; border-radius: 8px; background: #fff; color: #3a3320;
}
.fld input:focus, .fld select:focus { outline: none; border-color: #5a8835; }

/* --- выбор вида листа картинками --- */
.kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.kinds label {
  display: flex; align-items: flex-start; gap: 8px; cursor: pointer;
  border: 1.5px solid #d8cfa8; border-radius: 10px; background: #fff; padding: 9px 11px;
}
.kinds label:hover { border-color: #5a8835; background: #f8fbf1; }
.kinds input { margin-top: 3px; flex: none; }
.kinds input:checked + span { color: #3a5520; }
.kinds label:has(input:checked) { border-color: #5a8835; background: #f4f8ea; }
.kinds b { display: block; font-size: 14.5px; color: #4a6b2a; }
.kinds em { font-style: normal; font-size: 12.5px; color: #8a7a4a; line-height: 1.35; }

/* --- превью набора --- */
.preview {
  border: 1.5px solid #d8cfa8; border-radius: 12px; background: #fdf7e6; padding: 12px;
}
.preview .zone { margin: 0 0 10px; }
.preview .zone:last-child { margin-bottom: 0; }
.preview .zname {
  font-size: 13.5px; color: #4a6b2a; font-weight: 700; margin: 0 0 4px;
  display: flex; align-items: center; gap: 6px;
}
.preview .zname svg { display: block; width: 22px; height: 22px; flex: none; }
.preview .items { display: flex; flex-wrap: wrap; gap: 8px; }
.preview figure { margin: 0; width: 84px; text-align: center; }
.preview figure svg { display: block; width: 58px; height: 58px; margin: 0 auto; }
.preview figcaption { font-size: 11px; color: #8a7a4a; margin-top: 2px; line-height: 1.2; }
.preview .arr { color: #b8862c; align-self: center; }

/* --- кнопки --- */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }
.actions button, .actions a.btn {
  font-family: Georgia, serif; font-size: 15px; padding: 11px 20px; cursor: pointer;
  border: 1.5px solid #d8cfa8; border-radius: 10px; background: #fffdf5; color: #4a6b2a;
  font-weight: 700; text-decoration: none; display: inline-block;
}
.actions button:hover, .actions a.btn:hover { border-color: #5a8835; background: #f4f8ea; }
.actions button.primary { background: #c8d8a4; border-color: #5a8835; color: #3a5520; }
.actions button.primary:hover { background: #d6e4b6; }

.note {
  margin: 12px 0 0; padding: 10px 12px; font-size: 13px; line-height: 1.5;
  background: #f4f8ea; border: 1.5px solid #a8c880; border-radius: 8px; color: #3a5520;
  word-break: break-word;
}

@media (max-width: 620px) {
  .card { padding: 20px 16px 24px; }
  h1 { font-size: 23px; }
  .preview figure { width: 72px; }
  .preview figure svg { width: 50px; height: 50px; }
}

/* --- онлайн-игра --- */
.card.game { max-width: 900px; }
.game .task { margin: 0 0 14px; font-size: 16px; color: #6a5a2a; line-height: 1.45; }

.zones { display: flex; gap: 10px; margin: 0 0 16px; }
.zones.rows { flex-direction: column; }
.dropzone {
  flex: 1; min-height: 168px; border: 2px dashed #c3b68e; border-radius: 12px;
  background: #fdf7e6; padding: 8px; display: flex; flex-direction: column; gap: 6px;
}
.dropzone.over { border-color: #5a8835; background: #eef5e2; }
.dropzone .zhead {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 14px; font-weight: 700; color: #3a5520;
  background: #c8d8a4; border-radius: 8px; padding: 4px 8px;
}
.dropzone .zhead svg { display: block; width: 22px; height: 22px; flex: none; }
.dropzone .drop { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }

.tray {
  border: 2px solid #d8cfa8; border-radius: 12px; background: #fffdf5; padding: 10px;
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 92px;
}
.tray.over { border-color: #5a8835; }

.tile {
  width: 76px; height: 76px; border: 1.5px solid #d8cfa8; border-radius: 10px;
  background: #fff; display: flex; align-items: center; justify-content: center;
  cursor: grab; touch-action: none; user-select: none;
}
.tile svg { display: block; width: 62px; height: 62px; pointer-events: none; }
.tile.picked { border-color: #5a8835; background: #f4f8ea; box-shadow: 0 0 0 3px rgba(90,136,53,0.25); }
.tile.dragging { opacity: 0.45; }
.tile.wrong { border-color: #c85a1e; background: #fdece3; animation: vn-shake 0.3s; }
.tile.right { border-color: #5a8835; background: #eef5e2; }
@keyframes vn-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* строки «что сначала» и «найди пару» в онлайне */
.orow { display: flex; align-items: center; gap: 8px; }
.orow .prompt { flex: none; width: 62px; }
.orow .prompt svg { display: block; width: 62px; height: 62px; }
.orow .slot {
  flex: 1; min-height: 86px; border: 2px dashed #c3b68e; border-radius: 10px;
  background: #fdf7e6; display: flex; align-items: center; justify-content: center;
  position: relative;
}
.orow .slot.over { border-color: #5a8835; background: #eef5e2; }
.orow .slot b { position: absolute; top: 3px; left: 6px; font-size: 12px; color: #b8862c; font-weight: 400; }

.result { margin: 14px 0 0; font-size: 16px; color: #3a5520; min-height: 24px; }
.result.bad { color: #c85a1e; }
