.target-wrap { flex: none; text-align: center; padding: 8px 0 4px; }
.target-label { font-weight: 900; font-size: 0.9rem; color: var(--cyan); letter-spacing: 0.12em; text-transform: uppercase; }
.target {
  display: inline-block;
  min-width: 140px;
  margin-top: 4px;
  padding: 4px 26px;
  border: 3px solid var(--ink);
  border-radius: 22px;
  background: #fff;
  color: var(--ink);
  font: 700 3.6rem var(--num);
  box-shadow: 5px 5px 0 var(--ink);
}
.target.solved { background: var(--green); animation: pop 0.5s; }
@keyframes pop { 50% { transform: scale(1.12); } }

.tiles {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 14px;
}

.tile {
  min-width: 86px;
  min-height: 86px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--ink);
  border-radius: 20px;
  background: linear-gradient(180deg, #fff8cf 0%, var(--paper) 100%);
  color: var(--ink);
  font: 700 2.4rem var(--num);
  box-shadow: 4px 4px 0 var(--ink);
}
.tile small { font: 700 0.7rem var(--num); color: #4a3a8a; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.sel { background: linear-gradient(180deg, #c8f7ff 0%, var(--cyan) 100%); transform: translateY(-4px); }
.tile.hint { outline: 4px dashed var(--pink); outline-offset: 3px; }
.tile.shake { animation: shake 0.3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.tile:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }

.msg { flex: none; min-height: 4.2em; display: flex; align-items: center; justify-content: center; text-align: center; font: 800 0.95rem/1.25 Nunito, sans-serif; color: var(--paper); padding: 0 14px; }
.msg.bad { color: #ff9a9a; }

.ops { flex: none; display: flex; justify-content: center; gap: 10px; padding: 6px 14px; }
.op {
  width: 66px; height: 66px;
  border: 3px solid var(--ink); border-radius: 18px;
  background: var(--purple); color: #fff;
  font: 700 2rem var(--num);
  box-shadow: 4px 4px 0 var(--ink);
}
.op.sel { background: var(--cyan); color: var(--ink); transform: translateY(-3px); }
.op.hint { outline: 4px dashed var(--pink); outline-offset: 3px; }
.op:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }

.tools {
  flex: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 8px 12px calc(14px + env(safe-area-inset-bottom));
  background: #0c0624;
  border-top: 4px solid var(--ink);
}
.tool {
  min-height: 52px;
  border: 3px solid var(--ink); border-radius: 14px;
  background: var(--card);
  font: 900 0.85rem Nunito, sans-serif;
  box-shadow: 3px 3px 0 var(--ink);
}
.tool:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
