/* Gameficate Craft — How players answer: the answer-kind picker (js/ui/AnswerKindPicker.js), answers and choices on
   the map (js/sections/MapChoicesEditor.js, js/ui/mapFields.js) and the Match editor (js/sections/MatchEditor.js). */

/* ---------- Answer-kind picker ---------- */
.kind-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kp-step {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}
.kp-sub {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}
.kind-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}
.kind-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: 'icon title' 'icon desc';
  column-gap: 10px;
  align-items: center;
  padding: 10px 12px;
  text-align: left;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.kind-card:hover {
  border-color: color-mix(in srgb, var(--orange) 55%, var(--line));
}
.kind-card.on {
  border-color: var(--orange);
  background: color-mix(in srgb, var(--orange) 8%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 20%, transparent);
}
.kc-icon {
  grid-area: icon;
  font-size: 26px;
}
.kind-card b {
  grid-area: title;
  font-size: 15px;
  color: var(--navy);
}
.kc-desc {
  grid-area: desc;
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
}
/* Segmented choices (Answer with, What can be tapped). */
.kind-picker .seg,
.q-difficulty .seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.kind-picker .seg button,
.q-difficulty .seg button {
  padding: 8px 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-weight: 800;
  color: var(--navy);
  cursor: pointer;
}
.kind-picker .seg button.on,
.q-difficulty .seg button.on {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 12%, #fff);
}

/* ---------- Answers & choices on the map ---------- */
.map-choices h4,
.match-card h4 {
  margin: 14px 0 6px;
}
.radio-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.radio-list label.radio {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}
.radio-list label.radio:has(input:checked) {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 8%, #fff);
}
.radio-list label.radio > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* Area names as chips. */
.name-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.name-list .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.name-list .chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px 4px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--navy) 8%, #fff);
  border: 1px solid var(--line);
  font-weight: 800;
  font-size: 14px;
  color: var(--navy);
  cursor: default;
}
.name-list .chip button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 16px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.name-list .chip button:hover {
  background: color-mix(in srgb, var(--red) 15%, #fff);
  color: var(--red);
}
.name-list .row input {
  flex: 1;
  min-width: 0;
}
/* Places: one row each — number, name, latitude, longitude, pick, remove. */
.place-list,
.match-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.place-row,
.match-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.place-row input[type='text'],
.match-row input[type='text'] {
  flex: 1 1 160px;
  min-width: 0;
}
.place-row input[type='number'],
.match-row input[type='number'] {
  flex: 0 0 110px;
  width: 110px;
}
.place-n {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--soft);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 900;
  color: var(--muted);
}
.add-place {
  align-self: flex-start;
}
/* A quiz option's map link, under its text. */
.map-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.map-link select {
  width: auto;
  min-width: 200px;
  height: 36px;
  padding-right: 28px;
  font-size: 13px;
}
.map-link-body {
  display: contents;
}
.map-link input {
  height: 34px;
  font-size: 13px;
  width: 120px;
  flex: 0 1 auto;
}
.map-link input[type='text'] {
  width: 200px;
}

/* ---------- Match editor ---------- */
.mt-dot {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--mc);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}
.match-kind {
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--soft);
  font-weight: 800;
  color: var(--navy);
}
.match-grid-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.match-grid {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
.match-grid th,
.match-grid td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
}
.match-grid thead th {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  color: var(--muted);
  background: var(--soft);
}
.match-grid tbody th {
  text-align: left;
  font-weight: 800;
  color: var(--navy);
}
.match-grid input[type='checkbox'] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* Difficulty of a question (Category & answer card). */
.q-difficulty {
  margin: 12px 0 4px;
}
