/* Little Town Builder - paint a town onto a grid.
   Shared shell, buttons and colours come from kids-common.css. */

.town-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid #7fbf6a;
}

#town {
  display: block;
  width: 100%;
  height: auto;
  /* Drawing roads is a drag; the page mustn't scroll under the finger. */
  touch-action: none;
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
}

.movers {
  pointer-events: none;
}

.placed {
  animation: town-place 0.3s ease-out;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes town-place {
  from { transform: scale(0.6); opacity: 0.4; }
  to { transform: scale(1); opacity: 1; }
}

/* ===================== Tool palette ===================== */

.town-tools {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.town-tool {
  border: 3px solid var(--kids-border);
  background: var(--kids-card);
  border-radius: 14px;
  padding: 4px 2px;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--kids-ink-soft);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1.1;
}

.town-tool .t-emoji {
  font-size: 1.7rem;
  line-height: 1.15;
}

.town-tool.on {
  border-color: var(--kids-lilac);
  background: #eeecff;
  box-shadow: 0 0 0 3px #c9c4f5;
}

.town-tool:active {
  transform: scale(0.94);
}

/* ===================== Jobs ===================== */

.jobs {
  margin-top: 12px;
  background: var(--kids-card);
  border: 3px solid var(--kids-border);
  border-radius: 16px;
  padding: 8px 12px;
}

.jobs-title {
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--kids-ink-soft);
  margin-bottom: 4px;
  display: flex;
}

.jobs-title span {
  margin-left: auto;
  color: var(--kids-amber);
}

.job {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--kids-muted);
  border-top: 1px solid #f0eef9;
}

.job:first-of-type {
  border-top: none;
}

.job .j-emoji {
  font-size: 1.3rem;
  width: 28px;
  text-align: center;
}

.job .j-tick {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border-radius: 13px;
  border: 3px solid var(--kids-border);
  flex-shrink: 0;
  text-align: center;
  line-height: 20px;
  font-size: 0.9rem;
  color: #fff;
}

.job.done {
  color: var(--kids-green);
}

.job.done .j-tick {
  background: var(--kids-green);
  border-color: var(--kids-green);
}

.job.done .j-tick::after {
  content: "✔";
}

.job.just {
  animation: kids-pop 0.5s;
}

.town-actions {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.town-actions .big-btn {
  max-width: 260px;
}

@media (max-width: 380px) {
  .town-tools {
    grid-template-columns: repeat(5, 1fr);
  }
  .town-tool .t-emoji {
    font-size: 1.4rem;
  }
  .town-tool {
    font-size: 0.6rem;
  }
}
